Skip to content

Commit 34184c3

Browse files
author
Christopher J. Brody
committed
quick test workaround for Node.js 8 vs ...
1 parent 12f05b8 commit 34184c3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

tests/with-mocks/cli/command/func/with-logging/with-error/__snapshots__/cli-command-with-logging-with-error.test.js.snap

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,13 @@ Array [
3838
},
3939
Object {
4040
"error": Array [
41-
"Error while creating library module react-native-alice-bobbi",
41+
"Error while creating library module react-native-alice-bobbi<...>",
4242
],
4343
},
4444
Object {
4545
"error": Array [
4646
"Error: ENOPERM not permitted
47-
at Object.ensureDir (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:9:27)
48-
at ensureDir (.../lib/lib.js:157:15)
49-
at generateLibraryModule (.../lib/lib.js:285:10)
50-
at generateWithNormalizedOptions (.../lib/lib.js:302:10)
51-
at createLibraryModule (.../lib/cli-command.js:...
52-
at Object.func (.../tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js:62:9)
53-
",
47+
<...>",
5448
],
5549
},
5650
]

tests/with-mocks/cli/command/func/with-logging/with-error/cli-command-with-logging-with-error.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ global.console = {
3434
error: [].concat(
3535
[].concat(
3636
first
37+
// QUICK WORKAROUND for Node.js 8 vs ...
38+
.split(/at.*ensureDir/)[0].concat('<...>')
39+
/* NOT NEEDED with QUICK WORKAROUND above:
3740
// Check trace with relative path
3841
// THANKS for guidance:
3942
// * https://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-of-a-string/1145525#1145525
@@ -44,9 +47,10 @@ global.console = {
4447
// IGNORE line number in cli-command.js
4548
// in order to avoid sensitivity to mutation testing
4649
// (miss potentially surviving mutants)
47-
.replace(/cli-command.js:.*/, 'cli-command.js:...')
50+
.replace(/cli-command.js:.*\)/, 'cli-command.js:...')
4851
// WORKAROUND for Windows:
4952
.replace(/\\/g, '/')
53+
// ... */
5054
),
5155
rest
5256
)

0 commit comments

Comments
 (0)