Skip to content

Commit a2b9f2c

Browse files
committed
test(snapshot): temp skip new node-notifier options to find other differences
no differences in existing tests, excellent work😃
1 parent 99cbac1 commit a2b9f2c

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

test/VerbosityLevelAllVariants.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import {contentImageSerializer, reduceArraySerializer, testChangesFlow} from './helpers/utils';
1+
import {changedOptionsSerializer, contentImageSerializer, reduceArraySerializer, testChangesFlow} from './helpers/utils';
22

33
expect.addSnapshotSerializer(reduceArraySerializer);
44
expect.addSnapshotSerializer(contentImageSerializer);
5+
expect.addSnapshotSerializer(changedOptionsSerializer);
56

67
describe('VerbosityLevelAllVariants', () => {
78
describe.each([...generateOptions()])('%j', (opts) => {

test/WebpackNotifierPlugin.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import {join} from 'path';
2-
import {contentImageSerializer, reduceArraySerializer, testChangesFlow, TestArguments} from './helpers/utils';
2+
import {contentImageSerializer, reduceArraySerializer, changedOptionsSerializer, testChangesFlow, TestArguments} from './helpers/utils';
33
import CustomWarningPlugin from './helpers/CustomWarningPlugin';
44
import ChildCompilationPlugin from './helpers/ChildCompilationPlugin';
55

66
expect.addSnapshotSerializer(reduceArraySerializer);
77
expect.addSnapshotSerializer(contentImageSerializer);
8+
expect.addSnapshotSerializer(changedOptionsSerializer);
89

910
describe('WebpackNotifierPlugin', () => {
1011
describe('one compilation', () => {

test/helpers/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ export const contentImageSerializer = {
8888
return printer(modifiedVal, config, indentation, depth, refs);
8989
},
9090
};
91+
export const changedOptionsSerializer = {
92+
test(val) {
93+
return typeof val === 'object' && val.hasOwnProperty('location');
94+
},
95+
serialize(val, config, indentation, depth, refs, printer) {
96+
delete val.location;
97+
delete val.wait;
98+
return printer(val, config, indentation, depth, refs);
99+
},
100+
};
91101

92102
export type Sources = string[];
93103
export type PluginOptions = {} | undefined;

0 commit comments

Comments
 (0)