Skip to content

Commit a6a6816

Browse files
committed
test: refactor
1 parent 6e60f44 commit a6a6816

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
@@ -905,7 +905,9 @@ describe('CLI', () => {
905905
testBin('--static')
906906
.then((output) => {
907907
expect(output.exitCode).toEqual(0);
908-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
908+
expect(
909+
normalizeStderr(output.stderr, { ipv6: true })
910+
).toMatchSnapshot('stderr');
909911
done();
910912
})
911913
.catch(done);
@@ -915,7 +917,9 @@ describe('CLI', () => {
915917
testBin('--static new-static')
916918
.then((output) => {
917919
expect(output.exitCode).toEqual(0);
918-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
920+
expect(
921+
normalizeStderr(output.stderr, { ipv6: true })
922+
).toMatchSnapshot('stderr');
919923
done();
920924
})
921925
.catch(done);
@@ -925,7 +929,9 @@ describe('CLI', () => {
925929
testBin('--static-reset --static new-static-after-reset')
926930
.then((output) => {
927931
expect(output.exitCode).toEqual(0);
928-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
932+
expect(
933+
normalizeStderr(output.stderr, { ipv6: true })
934+
).toMatchSnapshot('stderr');
929935
done();
930936
})
931937
.catch(done);
@@ -935,7 +941,9 @@ describe('CLI', () => {
935941
testBin('--static-reset --static-directory new-static-directory')
936942
.then((output) => {
937943
expect(output.exitCode).toEqual(0);
938-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
944+
expect(
945+
normalizeStderr(output.stderr, { ipv6: true })
946+
).toMatchSnapshot('stderr');
939947
done();
940948
})
941949
.catch(done);
@@ -945,7 +953,9 @@ describe('CLI', () => {
945953
testBin('--static-directory static-dir')
946954
.then((output) => {
947955
expect(output.exitCode).toEqual(0);
948-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
956+
expect(
957+
normalizeStderr(output.stderr, { ipv6: true })
958+
).toMatchSnapshot('stderr');
949959
done();
950960
})
951961
.catch(done);
@@ -955,7 +965,9 @@ describe('CLI', () => {
955965
testBin('--static --static-directory static-dir')
956966
.then((output) => {
957967
expect(output.exitCode).toEqual(0);
958-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
968+
expect(
969+
normalizeStderr(output.stderr, { ipv6: true })
970+
).toMatchSnapshot('stderr');
959971
done();
960972
})
961973
.catch(done);
@@ -965,7 +977,9 @@ describe('CLI', () => {
965977
testBin('--static-public-path /public')
966978
.then((output) => {
967979
expect(output.exitCode).toEqual(0);
968-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
980+
expect(
981+
normalizeStderr(output.stderr, { ipv6: true })
982+
).toMatchSnapshot('stderr');
969983
done();
970984
})
971985
.catch(done);
@@ -975,7 +989,9 @@ describe('CLI', () => {
975989
testBin('--static-public-path-reset --static-public-path /new-public')
976990
.then((output) => {
977991
expect(output.exitCode).toEqual(0);
978-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
992+
expect(
993+
normalizeStderr(output.stderr, { ipv6: true })
994+
).toMatchSnapshot('stderr');
979995
done();
980996
})
981997
.catch(done);
@@ -985,7 +1001,9 @@ describe('CLI', () => {
9851001
testBin('--static-serve-index')
9861002
.then((output) => {
9871003
expect(output.exitCode).toEqual(0);
988-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1004+
expect(
1005+
normalizeStderr(output.stderr, { ipv6: true })
1006+
).toMatchSnapshot('stderr');
9891007
done();
9901008
})
9911009
.catch(done);
@@ -995,7 +1013,9 @@ describe('CLI', () => {
9951013
testBin('--no-static-serve-index')
9961014
.then((output) => {
9971015
expect(output.exitCode).toEqual(0);
998-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1016+
expect(
1017+
normalizeStderr(output.stderr, { ipv6: true })
1018+
).toMatchSnapshot('stderr');
9991019
done();
10001020
})
10011021
.catch(done);
@@ -1005,7 +1025,9 @@ describe('CLI', () => {
10051025
testBin('--static-watch')
10061026
.then((output) => {
10071027
expect(output.exitCode).toEqual(0);
1008-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1028+
expect(
1029+
normalizeStderr(output.stderr, { ipv6: true })
1030+
).toMatchSnapshot('stderr');
10091031
done();
10101032
})
10111033
.catch(done);
@@ -1015,7 +1037,9 @@ describe('CLI', () => {
10151037
testBin('--static-watch')
10161038
.then((output) => {
10171039
expect(output.exitCode).toEqual(0);
1018-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1040+
expect(
1041+
normalizeStderr(output.stderr, { ipv6: true })
1042+
).toMatchSnapshot('stderr');
10191043
done();
10201044
})
10211045
.catch(done);
@@ -1032,7 +1056,9 @@ describe('CLI', () => {
10321056
testBin(`--watch-files ${watchDirectory}`)
10331057
.then((output) => {
10341058
expect(output.exitCode).toEqual(0);
1035-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1059+
expect(
1060+
normalizeStderr(output.stderr, { ipv6: true })
1061+
).toMatchSnapshot('stderr');
10361062
done();
10371063
})
10381064
.catch(done);
@@ -1047,7 +1073,9 @@ describe('CLI', () => {
10471073
testBin(`--watch-files-reset --watch-files ${watchDirectory}`)
10481074
.then((output) => {
10491075
expect(output.exitCode).toEqual(0);
1050-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1076+
expect(
1077+
normalizeStderr(output.stderr, { ipv6: true })
1078+
).toMatchSnapshot('stderr');
10511079
done();
10521080
})
10531081
.catch(done);
@@ -1062,7 +1090,9 @@ describe('CLI', () => {
10621090
testBin(`--watch-files-reset --watch-files-paths ${watchDirectory}`)
10631091
.then((output) => {
10641092
expect(output.exitCode).toEqual(0);
1065-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1093+
expect(
1094+
normalizeStderr(output.stderr, { ipv6: true })
1095+
).toMatchSnapshot('stderr');
10661096
done();
10671097
})
10681098
.catch(done);
@@ -1077,7 +1107,9 @@ describe('CLI', () => {
10771107
testBin(`--watch-files-paths ${watchDirectory}`)
10781108
.then((output) => {
10791109
expect(output.exitCode).toEqual(0);
1080-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1110+
expect(
1111+
normalizeStderr(output.stderr, { ipv6: true })
1112+
).toMatchSnapshot('stderr');
10811113
done();
10821114
})
10831115
.catch(done);
@@ -1092,7 +1124,9 @@ describe('CLI', () => {
10921124
testBin(`--watch-files-paths-reset --watch-files-paths ${watchDirectory}`)
10931125
.then((output) => {
10941126
expect(output.exitCode).toEqual(0);
1095-
expect(normalizeStderr(output.stderr)).toMatchSnapshot('stderr');
1127+
expect(
1128+
normalizeStderr(output.stderr, { ipv6: true })
1129+
).toMatchSnapshot('stderr');
10961130
done();
10971131
})
10981132
.catch(done);

0 commit comments

Comments
 (0)