Skip to content

Commit

Permalink
Test tsExtraMock instead of reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Mar 7, 2020
1 parent 6b3900b commit 340737d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/cli/test/scripts/startDev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ describe('Start command', () => {

it('copies each file to the .blitz folder', () => {
const root = resolve(__dirname, './startDev')
expect(reporterMock.reporter.copy.mock.calls).toEqual([
const copyOpts = {dereference: true}
expect(fsExtraMock.copy.mock.calls).toEqual([
// .now should be ignored
[root, resolve(root, 'one'), resolve(root, '.blitz/one')],
[root, resolve(root, 'two'), resolve(root, '.blitz/two')],
[resolve(root, 'one'), resolve(root, '.blitz/one'), copyOpts],
[resolve(root, 'two'), resolve(root, '.blitz/two'), copyOpts],
])
})

it('calls spawn with the next cli bin', () => {
expect(childProcessMock.spawn).toBeCalledWith('../node_modules/.bin/next', ['dev'], {
expect(childProcessMock.spawn).toHaveBeenCalledWith('../node_modules/.bin/next', ['dev'], {
cwd: resolve(__dirname, './startDev/.blitz'),
stdio: 'inherit',
})
Expand Down

0 comments on commit 340737d

Please sign in to comment.