Skip to content

Commit 94f3085

Browse files
committed
test: get tests working with type=module
1 parent 62d0ede commit 94f3085

5 files changed

Lines changed: 13 additions & 25 deletions

File tree

package-lock.json

Lines changed: 8 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lint": "eslint --report-unused-disable-directives . --color --ext .js,.ts,.tsx && tsc --noEmit",
2727
"prepublishOnly": "npm run build",
2828
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'",
29-
"test": "mocha -r ts-node/register --extension ts"
29+
"test": "node --loader ts-node/esm.mjs node_modules/mocha/lib/cli/cli.js"
3030
},
3131
"prettier": "@github/prettier-config",
3232
"eslintConfig": {
@@ -76,7 +76,7 @@
7676
"eslint-plugin-escompat": "^3.1.0",
7777
"eslint-plugin-github": "^4.0.1",
7878
"mocha": "^8.0.1",
79-
"ts-node": "^8.10.2",
79+
"ts-node": "github:TypeStrong/ts-node#866bce6a175ec124fe62f269b22e91c92b40f875",
8080
"typescript": "^3.9.6"
8181
}
8282
}

test/decorator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import memoize from '../decorator'
2-
import {describe, it} from 'mocha'
1+
import memoize from '../decorator.js'
32
import chai from 'chai'
43
import spies from 'chai-spies'
54
chai.use(spies)

test/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* globals process */
2-
import memoize from '../index'
3-
import {beforeEach, describe, it} from 'mocha'
2+
import memoize from '../index.js'
43
import chai from 'chai'
54
import spies from 'chai-spies'
65
chai.use(spies)

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"noImplicitReturns": true,
88
"noFallthroughCasesInSwitch": true,
99
"target": "ES2016",
10+
"module": "ESNext",
1011
"moduleResolution": "node",
1112
"declaration": true,
1213
"declarationMap": true,

0 commit comments

Comments
 (0)