Skip to content

Commit 8a6c83b

Browse files
snitin315alexander-akait
authored andcommitted
test: refactor
1 parent 42760f3 commit 8a6c83b

File tree

1 file changed

+51
-17
lines changed

1 file changed

+51
-17
lines changed

test/cli/cli.test.js

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,9 @@ describe('CLI', () => {
931931
testBin('--static')
932932
.then((output) => {
933933
expect(output.exitCode).toEqual(0);
934-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
934+
expect(
935+
normalizeStderr(output.stderr, { ipv6: true })
936+
).toMatchSnapshot('stderr');
935937
done();
936938
})
937939
.catch(done);
@@ -941,7 +943,9 @@ describe('CLI', () => {
941943
testBin('--static new-static')
942944
.then((output) => {
943945
expect(output.exitCode).toEqual(0);
944-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
946+
expect(
947+
normalizeStderr(output.stderr, { ipv6: true })
948+
).toMatchSnapshot('stderr');
945949
done();
946950
})
947951
.catch(done);
@@ -951,7 +955,9 @@ describe('CLI', () => {
951955
testBin('--static-reset --static new-static-after-reset')
952956
.then((output) => {
953957
expect(output.exitCode).toEqual(0);
954-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
958+
expect(
959+
normalizeStderr(output.stderr, { ipv6: true })
960+
).toMatchSnapshot('stderr');
955961
done();
956962
})
957963
.catch(done);
@@ -961,7 +967,9 @@ describe('CLI', () => {
961967
testBin('--static-reset --static-directory new-static-directory')
962968
.then((output) => {
963969
expect(output.exitCode).toEqual(0);
964-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
970+
expect(
971+
normalizeStderr(output.stderr, { ipv6: true })
972+
).toMatchSnapshot('stderr');
965973
done();
966974
})
967975
.catch(done);
@@ -971,7 +979,9 @@ describe('CLI', () => {
971979
testBin('--static-directory static-dir')
972980
.then((output) => {
973981
expect(output.exitCode).toEqual(0);
974-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
982+
expect(
983+
normalizeStderr(output.stderr, { ipv6: true })
984+
).toMatchSnapshot('stderr');
975985
done();
976986
})
977987
.catch(done);
@@ -981,7 +991,9 @@ describe('CLI', () => {
981991
testBin('--static --static-directory static-dir')
982992
.then((output) => {
983993
expect(output.exitCode).toEqual(0);
984-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
994+
expect(
995+
normalizeStderr(output.stderr, { ipv6: true })
996+
).toMatchSnapshot('stderr');
985997
done();
986998
})
987999
.catch(done);
@@ -991,7 +1003,9 @@ describe('CLI', () => {
9911003
testBin('--static-public-path /public')
9921004
.then((output) => {
9931005
expect(output.exitCode).toEqual(0);
994-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1006+
expect(
1007+
normalizeStderr(output.stderr, { ipv6: true })
1008+
).toMatchSnapshot('stderr');
9951009
done();
9961010
})
9971011
.catch(done);
@@ -1001,7 +1015,9 @@ describe('CLI', () => {
10011015
testBin('--static-public-path-reset --static-public-path /new-public')
10021016
.then((output) => {
10031017
expect(output.exitCode).toEqual(0);
1004-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1018+
expect(
1019+
normalizeStderr(output.stderr, { ipv6: true })
1020+
).toMatchSnapshot('stderr');
10051021
done();
10061022
})
10071023
.catch(done);
@@ -1011,7 +1027,9 @@ describe('CLI', () => {
10111027
testBin('--static-serve-index')
10121028
.then((output) => {
10131029
expect(output.exitCode).toEqual(0);
1014-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1030+
expect(
1031+
normalizeStderr(output.stderr, { ipv6: true })
1032+
).toMatchSnapshot('stderr');
10151033
done();
10161034
})
10171035
.catch(done);
@@ -1021,7 +1039,9 @@ describe('CLI', () => {
10211039
testBin('--no-static-serve-index')
10221040
.then((output) => {
10231041
expect(output.exitCode).toEqual(0);
1024-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1042+
expect(
1043+
normalizeStderr(output.stderr, { ipv6: true })
1044+
).toMatchSnapshot('stderr');
10251045
done();
10261046
})
10271047
.catch(done);
@@ -1031,7 +1051,9 @@ describe('CLI', () => {
10311051
testBin('--static-watch')
10321052
.then((output) => {
10331053
expect(output.exitCode).toEqual(0);
1034-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1054+
expect(
1055+
normalizeStderr(output.stderr, { ipv6: true })
1056+
).toMatchSnapshot('stderr');
10351057
done();
10361058
})
10371059
.catch(done);
@@ -1041,7 +1063,9 @@ describe('CLI', () => {
10411063
testBin('--static-watch')
10421064
.then((output) => {
10431065
expect(output.exitCode).toEqual(0);
1044-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1066+
expect(
1067+
normalizeStderr(output.stderr, { ipv6: true })
1068+
).toMatchSnapshot('stderr');
10451069
done();
10461070
})
10471071
.catch(done);
@@ -1058,7 +1082,9 @@ describe('CLI', () => {
10581082
testBin(`--watch-files ${watchDirectory}`)
10591083
.then((output) => {
10601084
expect(output.exitCode).toEqual(0);
1061-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1085+
expect(
1086+
normalizeStderr(output.stderr, { ipv6: true })
1087+
).toMatchSnapshot('stderr');
10621088
done();
10631089
})
10641090
.catch(done);
@@ -1073,7 +1099,9 @@ describe('CLI', () => {
10731099
testBin(`--watch-files-reset --watch-files ${watchDirectory}`)
10741100
.then((output) => {
10751101
expect(output.exitCode).toEqual(0);
1076-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1102+
expect(
1103+
normalizeStderr(output.stderr, { ipv6: true })
1104+
).toMatchSnapshot('stderr');
10771105
done();
10781106
})
10791107
.catch(done);
@@ -1088,7 +1116,9 @@ describe('CLI', () => {
10881116
testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`)
10891117
.then((output) => {
10901118
expect(output.exitCode).toEqual(0);
1091-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1119+
expect(
1120+
normalizeStderr(output.stderr, { ipv6: true })
1121+
).toMatchSnapshot('stderr');
10921122
done();
10931123
})
10941124
.catch(done);
@@ -1103,7 +1133,9 @@ describe('CLI', () => {
11031133
testBin(`--watch-files-paths ${watchDirectory}`)
11041134
.then((output) => {
11051135
expect(output.exitCode).toEqual(0);
1106-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1136+
expect(
1137+
normalizeStderr(output.stderr, { ipv6: true })
1138+
).toMatchSnapshot('stderr');
11071139
done();
11081140
})
11091141
.catch(done);
@@ -1118,7 +1150,9 @@ describe('CLI', () => {
11181150
testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`)
11191151
.then((output) => {
11201152
expect(output.exitCode).toEqual(0);
1121-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1153+
expect(
1154+
normalizeStderr(output.stderr, { ipv6: true })
1155+
).toMatchSnapshot('stderr');
11221156
done();
11231157
})
11241158
.catch(done);

0 commit comments

Comments
 (0)