File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -22,21 +22,20 @@ jobs:
2222 with :
2323 node-version : ' 18'
2424
25- - name : Install dependencies
25+ - name : Install dependencies and set up ESM
2626 run : |
2727 npm init -y
28+ # Add "type": "module" using jq
29+ jq '. + {type: "module"}' package.json > tmp.json && mv tmp.json package.json
2830 npm install mocha chai jsdom jsdom-global
2931
3032 - name : Create test file
3133 run : |
3234 mkdir -p test
3335 cat << 'EOF' > test/surreal.test.js
34- require('jsdom-global/register');
35- const chai = require('chai');
36- const expect = chai.expect;
37-
38- // Load surreal.js script into the global scope
39- require('../surreal.js');
36+ import 'jsdom-global/register.js';
37+ import { expect } from 'chai';
38+ import '../surreal.js';
4039
4140 describe('Surreal.js Basic Tests', () => {
4241 it('should have Surreal defined globally', () => {
You can’t perform that action at this time.
0 commit comments