Skip to content

Commit

Permalink
🚑 Hotfix: Revert "Use esm with mocha" 6e68705
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tolauwae committed Jan 23, 2024
1 parent f2d694c commit ff677e8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 72 deletions.
2 changes: 1 addition & 1 deletion bin/latch.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
const {spawn} = require('child_process');

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));
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));
const proc = spawn('mocha', args, {
stdio: 'inherit'
});
Expand Down
6 changes: 0 additions & 6 deletions mocharc.json

This file was deleted.

62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "latch",
"description": "A testing language for constraint environments",
"version": "0.0.1",
"type": "module",
"type": "commonjs",
"exports": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.cjs"
Expand Down
31 changes: 0 additions & 31 deletions test/module.ts

This file was deleted.

3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "node",
"module": "commonjs",
"target": "ES2020",
"outDir": "out",
"lib": [
Expand Down

0 comments on commit ff677e8

Please sign in to comment.