From e66b3719e6b359deb673226bb3ea837d482b3646 Mon Sep 17 00:00:00 2001 From: Exile Date: Fri, 29 Dec 2023 14:19:43 +0200 Subject: [PATCH] Chai is now consumable as ES module Changed the test file to .mjs and made required changes to keep existing syntax --- test/{test-local.js => test-local.mjs} | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) rename test/{test-local.js => test-local.mjs} (99%) diff --git a/test/test-local.js b/test/test-local.mjs similarity index 99% rename from test/test-local.js rename to test/test-local.mjs index fe2524d..26e1e8d 100644 --- a/test/test-local.js +++ b/test/test-local.mjs @@ -3,7 +3,16 @@ "use server"; "use mocha"; -var expect = require('chai').expect; +import { expect } from 'chai'; + +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +import { createRequire } from "module"; +const require = createRequire(import.meta.url); describe('vfs-local', function () {