Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Mocha one major version #507

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Bump Mocha one major version #507

merged 1 commit into from
Mar 20, 2024

Conversation

ExplodingCabbage
Copy link
Collaborator

The latest tiny step in my attempts to upgrade the build pipeline used by this project. (I want it all up to date so that when I introduce TypeScript, I can rely on the latest docs for the tools being used. I am not very knowledgeable about JavaScript build tools and if I have to try to figure out how to make stuff work with versions of them that are years out of date then I'm going to end up tearing my hair out.)

Upgrading to version 8 breaks stuff, currently, which is why I'm only going up one major version at the moment. Output of yarn test with version 8 is as follows:

Running "mocha_istanbul:coverage" (mocha_istanbul) task

/home/mark/jsdiff/test/convert/dmp.js:1
import {convertChangesToDMP} from '../../lib/convert/dmp';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1288:20)
    at Module._compile (node:internal/modules/cjs/loader:1340:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module._extensions.<computed> [as .js] (/home/mark/jsdiff/node_modules/istanbul/lib/hook.js:109:37)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at exports.requireOrImport (/home/mark/jsdiff/node_modules/mocha/lib/esm-utils.js:42:12)
    at exports.loadFilesAsync (/home/mark/jsdiff/node_modules/mocha/lib/esm-utils.js:55:34)
    at Mocha.loadFilesAsync (/home/mark/jsdiff/node_modules/mocha/lib/mocha.js:473:19)
    at singleRun (/home/mark/jsdiff/node_modules/mocha/lib/cli/run-helpers.js:125:15)
    at exports.runMocha (/home/mark/jsdiff/node_modules/mocha/lib/cli/run-helpers.js:190:10)
    at exports.handler (/home/mark/jsdiff/node_modules/mocha/lib/cli/run.js:362:11)
    at /home/mark/jsdiff/node_modules/yargs/build/index.cjs:443:71
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
No coverage information was collected, exit without writing coverage information

I am not really sure why the above happens; is it an incompatibility between version 8 and Kevin's Istanbul fork? Or between version 8 and the (ancient, abandoned) grunt-mocha-test package? Or something else, maybe? Will have to investigate - or maybe try to rip out grunt to sidestep the issue!

@ExplodingCabbage ExplodingCabbage merged commit b90a3eb into master Mar 20, 2024
@ExplodingCabbage ExplodingCabbage deleted the upgrade-mocha branch March 20, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant