Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
janicklas-ralph committed May 18, 2021
1 parent d733d76 commit e3ce13e
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions test/integration/font-optimization/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ describe('Font Optimization', () => {

expect(testCss).toStrictEqual(snapshotCss)
})

// Re-run build to check if it works when build is cached
it('should work when build is cached', async () => {
await nextBuild(appDir)
const testJson = JSON.parse(
await fs.readFile(builtPage('font-manifest.json'), {
encoding: 'utf-8',
})
)
expect(testJson.length).toBeGreaterThan(0)
})
}

describe('Font optimization for SSR apps', () => {
Expand All @@ -227,32 +238,6 @@ describe('Font Optimization', () => {
})
afterAll(() => killApp(app))
runTests()

// Re-run build to check if it works when build is cached
it('should work when build is cached', async () => {
let cachedAppDir = join(fixturesDir, 'with-google')
await nextBuild(cachedAppDir)
let testJson = JSON.parse(
await fs.readFile(
join(cachedAppDir, '.next', 'server', 'font-manifest.json'),
{
encoding: 'utf-8',
}
)
)
expect(testJson.length).toBeGreaterThan(0)
cachedAppDir = join(fixturesDir, 'with-typekit')
await nextBuild(cachedAppDir)
testJson = JSON.parse(
await fs.readFile(
join(cachedAppDir, '.next', 'server', 'font-manifest.json'),
{
encoding: 'utf-8',
}
)
)
expect(testJson.length).toBeGreaterThan(0)
})
})

describe('Font optimization for serverless apps', () => {
Expand Down

0 comments on commit e3ce13e

Please sign in to comment.