Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check CSS Test Output #10237

Merged
merged 12 commits into from Jan 23, 2020
30 changes: 21 additions & 9 deletions test/integration/css-customization/test/index.test.js
Expand Up @@ -16,8 +16,11 @@ describe('CSS Customization', () => {
await remove(join(appDir, '.next'))
})

it('should build successfully', async () => {
await nextBuild(appDir)
it('should compile successfully', async () => {
const { stdout } = await nextBuild(appDir, [], {
Timer marked this conversation as resolved.
Show resolved Hide resolved
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've compiled and prefixed`, async () => {
Expand Down Expand Up @@ -78,8 +81,11 @@ describe('Legacy Next-CSS Customization', () => {
await remove(join(appDir, '.next'))
})

it('should build successfully', async () => {
await nextBuild(appDir)
it('should compile successfully', async () => {
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've compiled and prefixed`, async () => {
Expand All @@ -103,8 +109,11 @@ describe('CSS Customization Array', () => {
await remove(join(appDir, '.next'))
})

it('should build successfully', async () => {
await nextBuild(appDir)
it('should compile successfully', async () => {
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've compiled and prefixed`, async () => {
Expand Down Expand Up @@ -168,9 +177,12 @@ describe('Bad CSS Customization', () => {
await remove(join(appDir, '.next'))
})

it('should build successfully', async () => {
const { stderr } = await nextBuild(appDir, [], { stderr: true })

it('should compile successfully', async () => {
const { stdout, stderr } = await nextBuild(appDir, [], {
stdout: true,
stderr: true,
})
expect(stdout).toMatch(/Compiled successfully/)
expect(stderr).toMatch(/field which is not supported.*?sourceMap/)
;[
'postcss-modules-values',
Expand Down
25 changes: 20 additions & 5 deletions test/integration/css-features/test/index.test.js
Expand Up @@ -13,7 +13,10 @@ describe('Browserslist: Old', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand All @@ -36,7 +39,10 @@ describe('Browserslist: New', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand All @@ -59,7 +65,10 @@ describe('Custom Properties: Pass-Through IE11', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand All @@ -82,7 +91,10 @@ describe('Custom Properties: Pass-Through Modern', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand Down Expand Up @@ -139,7 +151,10 @@ describe('CSS Modules: Import Global CSS', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand Down
35 changes: 28 additions & 7 deletions test/integration/css-modules/test/index.test.js
Expand Up @@ -25,7 +25,10 @@ describe('Basic CSS Module Support', () => {
let app
beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down Expand Up @@ -72,7 +75,10 @@ describe('3rd Party CSS Module Support', () => {
let app
beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down Expand Up @@ -143,7 +149,10 @@ describe('Has CSS Module in computed styles in Production', () => {
let app
beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down Expand Up @@ -258,7 +267,10 @@ describe('Valid CSS Module Usage from within node_modules', () => {
let appPort
let app
beforeAll(async () => {
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down Expand Up @@ -301,7 +313,10 @@ describe('Valid Nested CSS Module Usage from within node_modules', () => {
let appPort
let app
beforeAll(async () => {
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down Expand Up @@ -340,7 +355,10 @@ describe('CSS Module Composes Usage (Basic)', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand All @@ -364,7 +382,10 @@ describe('CSS Module Composes Usage (External)', () => {

beforeAll(async () => {
await remove(join(appDir, '.next'))
await nextBuild(appDir)
const { stdout } = await nextBuild(appDir, [], {
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
})

it(`should've emitted a single CSS file`, async () => {
Expand Down