Skip to content

Commit 2b488e6

Browse files
authored
Update test.yml
1 parent cc253ca commit 2b488e6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff 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', () => {

0 commit comments

Comments
 (0)