Skip to content

Commit 09f17a3

Browse files
committed
Remove todo tests
1 parent 596ec94 commit 09f17a3

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

src/onPostBuild.test.js

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ describe('onPostBuild', () => {
5656
expect(serveFolder).not.toHaveBeenCalled()
5757
})
5858

59-
describe('recording', () => {
60-
it.todo('records the test run when enabled and record key is specified')
61-
it.todo('does not record the test run when record key is missing')
62-
it.todo('does not record when recording is disabled')
63-
})
64-
6559
describe('start option', () => {
6660
it('runs the specified command', async () => {
6761
const startCommand = 'a start command'
@@ -233,8 +227,44 @@ describe('onPostBuild', () => {
233227
await expect(testFunction()).rejects.toBe(error)
234228
})
235229

236-
it.todo('runs the cypress tests')
230+
it('runs the cypress tests', async () => {
231+
const { testFunction, inputs } = setup({
232+
postBuildInputs: {
233+
enable: true,
234+
},
235+
})
236+
237+
await expect(testFunction()).resolves.toBe(undefined)
238+
// TODO: Improve this assertion
239+
expect(runCypressTests).toHaveBeenCalledWith(
240+
'http://localhost:8080',
241+
inputs.postBuild.record,
242+
inputs.postBuild.spec,
243+
undefined,
244+
undefined,
245+
'chromium',
246+
undefined,
247+
)
248+
})
249+
250+
it('processes the cypress test results', async () => {
251+
const { testFunction, inputs, utils } = setup({
252+
postBuildInputs: {
253+
enable: true,
254+
start: 'a start command',
255+
},
256+
})
257+
258+
const testResults = 'RESULTS'
259+
runCypressTests.mockReturnValue(testResults)
237260

238-
it.todo('processes the cypress test results')
261+
await expect(testFunction()).resolves.toBe(undefined)
262+
// TODO: Improve assertion
263+
expect(processCypressResults).toHaveBeenCalledWith(
264+
testResults,
265+
expect.any(Function),
266+
expect.any(Function),
267+
)
268+
})
239269
})
240270
})

0 commit comments

Comments
 (0)