-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>I am a home page</p> |
36 changes: 36 additions & 0 deletions
36
test/integration/export-progress-status-message/test/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* eslint-env jest */ | ||
|
||
import { join } from 'path' | ||
import { nextBuild, nextExportDefault } from 'next-test-utils' | ||
|
||
jest.setTimeout(1000 * 60 * 5) | ||
const appDir = join(__dirname, '../') | ||
|
||
describe('Export cli prints progress info', () => { | ||
let buildStdout | ||
let exportStdout | ||
beforeAll(async () => { | ||
const buildResult = await nextBuild(appDir, [], { stdout: true }) | ||
buildStdout = buildResult.stdout | ||
const exportResult = await nextExportDefault(appDir, { stdout: true }) | ||
exportStdout = exportResult.stdout | ||
}) | ||
|
||
it('build: should log with internally passed statusMessage', async () => { | ||
const lines = buildStdout.split('\n') | ||
// Search `info - Generating static pages (n/m)` line | ||
const found = lines.some((line) => | ||
/Generating static pages \(\d+\/\d+\)/.test(line) | ||
) | ||
|
||
expect(found).toBeTruthy() | ||
}) | ||
|
||
it('export: should log with default label', async () => { | ||
const lines = exportStdout.split('\n') | ||
// Search `info - Exporting (n/m)` line | ||
const found = lines.some((line) => /Exporting \(\d+\/\d+\)/.test(line)) | ||
|
||
expect(found).toBeTruthy() | ||
}) | ||
}) |