-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: making test-runner-run.mjs ignore colors #54552
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -4,6 +4,7 @@ import { join } from 'node:path'; | |||||||||||||||
import { describe, it, run } from 'node:test'; | ||||||||||||||||
import { dot, spec, tap } from 'node:test/reporters'; | ||||||||||||||||
import assert from 'node:assert'; | ||||||||||||||||
import util from 'node:util'; | ||||||||||||||||
|
||||||||||||||||
const testFixtures = fixtures.path('test-runner'); | ||||||||||||||||
|
||||||||||||||||
|
@@ -68,10 +69,10 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||||||||||||||
const result = await run({ | ||||||||||||||||
files: [join(testFixtures, 'default-behavior/test/random.cjs')] | ||||||||||||||||
}).compose(dot).toArray(); | ||||||||||||||||
assert.deepStrictEqual(result, [ | ||||||||||||||||
'.', | ||||||||||||||||
'\n', | ||||||||||||||||
]); | ||||||||||||||||
|
||||||||||||||||
assert.strictEqual(result.length, 2); | ||||||||||||||||
assert.strictEqual(util.stripVTControlCharacters(result[0]), '.'); | ||||||||||||||||
assert.strictEqual(result[1], '\n'); | ||||||||||||||||
Comment on lines
+73
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: using
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aduh95 I am 👎 on this. For 2 lines a loop is just overkill and introduces complexity and confusion IMHO |
||||||||||||||||
}); | ||||||||||||||||
|
||||||||||||||||
describe('should be piped with spec reporter', () => { | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is even needed, would there be a case where the length isn't two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RedYetiDev sure? I can add it, I don't think it is super valuable tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever you think is best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RedYetiDev well, updated 😄