Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 59986ab

Browse files
committed
[cypress] Fix integration tests to tolerate slow test color
The Mocha reporter prints the test duration in either medium (33m) or fast (90m) color, depending on the duration. This is a source of flakiness unless the tests accept both.
1 parent fdcac51 commit 59986ab

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/cypress-plugin/test/integration/src/verify-output.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const verifySpecOutputs = (
142142
// eslint-disable-next-line no-control-regex
143143
`^ {2}\x1B\\[35m {2}${PASS_SYMBOL}\x1B\\[39m\x1B\\[90m mixed: flake should be quarantined\x1B\\[0m\x1B\\[35m \\[flaky, quarantined]\x1B\\[39m\x1B\\[33m \\(attempt 2 of ${
144144
expectedRetries + 1
145-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
145+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
146146
)
147147
),
148148
]
@@ -170,7 +170,7 @@ const verifySpecOutputs = (
170170
// eslint-disable-next-line no-control-regex
171171
`^ {2}\x1B\\[33m {2}${PASS_SYMBOL}\x1B\\[0m\x1B\\[90m mixed: flake should be quarantined\x1B\\[0m\x1B\\[33m \\[flaky]\x1B\\[0m\x1B\\[33m \\(attempt 2 of ${
172172
expectedRetries + 1
173-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
173+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
174174
)
175175
),
176176
]
@@ -209,15 +209,15 @@ const verifySpecOutputs = (
209209
// eslint-disable-next-line no-control-regex
210210
`^ {2}\x1B\\[35m {2}${PASS_SYMBOL}\x1B\\[39m\x1B\\[90m mixed: should be flaky\x1B\\[0m\x1B\\[35m \\[flaky, quarantined]\x1B\\[39m\x1B\\[33m \\(attempt 2 of ${
211211
expectedRetries + 1
212-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
212+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
213213
)
214214
)
215215
: expectExt.stringMatching(
216216
new RegExp(
217217
// eslint-disable-next-line no-control-regex
218218
`^ {2}\x1B\\[33m {2}${PASS_SYMBOL}\x1B\\[0m\x1B\\[90m mixed: should be flaky\x1B\\[0m\x1B\\[33m \\[flaky]\x1B\\[0m\x1B\\[33m \\(attempt 2 of ${
219219
expectedRetries + 1
220-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
220+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
221221
)
222222
),
223223
]
@@ -226,7 +226,7 @@ const verifySpecOutputs = (
226226
expectExt.stringMatching(
227227
// eslint-disable-next-line no-control-regex
228228
new RegExp(
229-
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m mixed: should pass\\x1B\\[0m\\x1B\\[90m \\([0-9]+.+?\\)\\x1B\\[0m$`
229+
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m mixed: should pass\\x1B\\[0m\\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\\x1B\\[0m$`
230230
)
231231
),
232232
" \x1B[36m - mixed: should be skipped\x1B[0m",
@@ -709,7 +709,7 @@ const verifySpecOutputs = (
709709
expectedFlakeTestNameSuffix
710710
)}\x1B\\[0m\x1B\\[35m \\[flaky, quarantined]\x1B\\[39m\x1B\\[33m \\(attempt 2 of ${
711711
expectedRetries + 1
712-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
712+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
713713
)
714714
)
715715
: expectExt.stringMatching(
@@ -719,7 +719,7 @@ const verifySpecOutputs = (
719719
expectedFlakeTestNameSuffix
720720
)}\x1B\\[0m\x1B\\[33m \\[flaky]\x1B\\[0m\x1B\\[33m \\(attempt 2 of ${
721721
expectedRetries + 1
722-
}\\)\x1B\\[0m\x1B\\[90m \\([0-9]+.+?\\)\x1B\\[0m$`
722+
}\\)\x1B\\[0m\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\x1B\\[0m$`
723723
)
724724
),
725725
]
@@ -943,7 +943,7 @@ const verifySpecOutputs = (
943943
expectExt.stringMatching(
944944
// eslint-disable-next-line no-control-regex
945945
new RegExp(
946-
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should fail due to hook\\x1B\\[0m\\x1B\\[90m \\([0-9]+.+?\\)\\x1B\\[0m$`
946+
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should fail due to hook\\x1B\\[0m\\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\\x1B\\[0m$`
947947
)
948948
),
949949
]
@@ -980,7 +980,7 @@ const verifySpecOutputs = (
980980
expectExt.stringMatching(
981981
// eslint-disable-next-line no-control-regex
982982
new RegExp(
983-
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should be skipped\\x1B\\[0m\\x1B\\[90m \\([0-9]+.+?\\)\\x1B\\[0m$`
983+
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should be skipped\\x1B\\[0m\\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\\x1B\\[0m$`
984984
)
985985
),
986986
]
@@ -1102,14 +1102,14 @@ const verifySpecOutputs = (
11021102
expectExt.stringMatching(
11031103
// eslint-disable-next-line no-control-regex
11041104
new RegExp(
1105-
`^\\x1B\\[32m +${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should pass\\x1B\\[0m\\x1B\\[90m \\([0-9]+.+?\\)\\x1B\\[0m$`
1105+
`^\\x1B\\[32m +${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m should pass\\x1B\\[0m\\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\\x1B\\[0m$`
11061106
)
11071107
),
11081108
"\x1B[0m suite name\x1B[0m",
11091109
expectExt.stringMatching(
11101110
// eslint-disable-next-line no-control-regex
11111111
new RegExp(
1112-
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m suite test should pass\\x1B\\[0m\\x1B\\[90m \\([0-9]+.+?\\)\\x1B\\[0m$`
1112+
`^ {2}\\x1B\\[32m {2}${PASS_SYMBOL}\\x1B\\[0m\\x1B\\[90m suite test should pass\\x1B\\[0m\\x1B\\[(?:33|90)m \\([0-9]+.+?\\)\\x1B\\[0m$`
11131113
)
11141114
),
11151115
],

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy