Skip to content

Commit ff677e8

Browse files
committed
πŸš‘ Hotfix: Revert "Use esm with mocha" 6e68705
Mocha custom reporter still does not support ES Modules. As long as we use mocha, we cannot have top-level awaits, such as the one in `module.ts`. see #7
1 parent f2d694c commit ff677e8

File tree

6 files changed

+34
-72
lines changed

6 files changed

+34
-72
lines changed

β€Žbin/latch.cjsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
const {spawn} = require('child_process');
1212

13-
const args = ['--exit', '--color', '--reporter', `${require('path').dirname(__dirname)}/dist/cjs/framework/MochaReporter.cjs`, '--loader=ts-node/esm', '--experimental-specifier-resolution=node', '--require', 'ts-node/register', '--ui', 'bdd' ].concat(process.argv.slice(2));
13+
const args = ['--exit', '--color', '--reporter', `${require('path').dirname(__dirname)}/dist/cjs/framework/MochaReporter.cjs`, '--require', 'ts-node/register', '--ui', 'bdd'].concat(process.argv.slice(2));
1414
const proc = spawn('mocha', args, {
1515
stdio: 'inherit'
1616
});

β€Žmocharc.jsonβ€Ž

Lines changed: 0 additions & 6 deletions
This file was deleted.

β€Žpackage-lock.jsonβ€Ž

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

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "latch",
33
"description": "A testing language for constraint environments",
44
"version": "0.0.1",
5-
"type": "module",
5+
"type": "commonjs",
66
"exports": {
77
"types": "./dist/types/index.d.ts",
88
"require": "./dist/cjs/index.cjs"

β€Žtest/module.tsβ€Ž

Lines changed: 0 additions & 31 deletions
This file was deleted.

β€Žtsconfig.jsonβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compilerOptions": {
3-
"module": "esnext",
4-
"moduleResolution": "node",
3+
"module": "commonjs",
54
"target": "ES2020",
65
"outDir": "out",
76
"lib": [

0 commit comments

Comments
Β (0)