Skip to content

Commit

Permalink
fix/9919 remove isolated test, add integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrika committed Jan 23, 2020
1 parent c612fb1 commit 3f8c4f3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions test/integration/config-empty/next.config.js
@@ -0,0 +1,6 @@
/* eslint-disable */
{
experimental: {
basePath: '/docs'
}
}
1 change: 1 addition & 0 deletions test/integration/config-empty/pages/index.js
@@ -0,0 +1 @@
export default () => <div>Hello World</div>
17 changes: 17 additions & 0 deletions test/integration/config-empty/test/index.test.js
@@ -0,0 +1,17 @@
/* eslint-env jest */
/* global jasmine */
import { join } from 'path'
import { nextBuild } from 'next-test-utils'

jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5

describe('Empty configuration', () => {
it('should show relevant warning when configuration is not found', async () => {
const { stdout } = await nextBuild(join(__dirname, '..'), [], {
stdout: true,
})
expect(stdout).not.toMatch(
/Warning: Detected next.config.js, no exported configuration found./
)
})
})
3 changes: 0 additions & 3 deletions test/isolated/_resolvedata/no-export/next.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions test/isolated/config.test.js
Expand Up @@ -108,19 +108,4 @@ describe('config', () => {
)
expect(config.__test__ext).toBe('js')
})

it('Should log a warning when no exported configuration found', () => {
const spy = jest.spyOn(console, 'warn')

loadConfig(
PHASE_DEVELOPMENT_SERVER,
join(__dirname, '_resolvedata', 'no-export')
)

expect(spy.mock.calls[0][0]).toMatch(
'Detected next.config.js, no exported configuration found'
)

spy.mockRestore()
})
})

0 comments on commit 3f8c4f3

Please sign in to comment.