Skip to content

chore: Replace mocha/expect/nyc with node:test harness - #42

Open
FotoVerite wants to merge 1 commit into
gulpjs:mainfrom
FotoVerite:main
Open

FotoVerite wants to merge 1 commit into
gulpjs:mainfrom
FotoVerite:main

Conversation

@FotoVerite

Copy link
Copy Markdown
Contributor

Closes #41

@phated
phated self-requested a review October 27, 2026 19:55
@phated phated added this to v6 Oct 27, 2026
@github-project-automation github-project-automation Bot moved this to Todo in v6 Oct 27, 2026

@phated phated left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things

Comment thread test/parallel.js
setTimeout(function () {
expect("slow function should not be called").toEqual(undefined);
done(null, 2);
assert.fail("slow function should not be called");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually log as a failure if this assert.fail is reached? Because bach will catch all the errors thrown and would propagate it to the callback.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we just use the cb(null, 2) and comment that it should not show up in the output.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that is exactly what the same test in test/series.js does, so we should just standardize.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on standard, you pointed out in gulpjs/now-and-later#25 that node pattern was assert.fail I think that makes the most sense for surfacing an assert that shouldn't be called

Comment thread test/series.js

it("should execute functions in series, passing error", function (done) {
it("should execute functions in series, passing error", function (t, done) {
function slowFn(done) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name this done to cb for clarity

Comment thread test/series.js
it("should execute functions in series, passing error", function (t, done) {
function slowFn(done) {
setTimeout(function () {
done(null, 2);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

Comment thread test/settleParallel.js
Comment on lines 48 to 50
function slowFn(done) {
setTimeout(function () {
done(null, 2);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done -> cb

Comment thread test/settleSeries.js
Comment on lines 48 to 50
function slowFn(done) {
setTimeout(function () {
done(null, 2);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done -> cb

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in v6 Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Update test harness

2 participants