Commit 9993092d authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Add test for AMP errors during auto prerendering (#8335)

* Add test for AMP errors during auto-prerendering

* bump

* Add stats-app config for dynamic port

* bump

* bump
parent df30f5e4
...@@ -13,10 +13,28 @@ const appDir = join(__dirname, '../') ...@@ -13,10 +13,28 @@ const appDir = join(__dirname, '../')
const outDir = join(appDir, 'out') const outDir = join(appDir, 'out')
const nextConfig = new File(join(appDir, 'next.config.js')) const nextConfig = new File(join(appDir, 'next.config.js'))
let buildOutput
describe('AMP Validation on Export', () => { describe('AMP Validation on Export', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) const { stdout = '', stderr = '' } = await nextBuild(appDir, [], {
stdout: true,
stderr: true
})
await nextExport(appDir, { outdir: outDir }) await nextExport(appDir, { outdir: outDir })
buildOutput = stdout + stderr
})
it('should have shown errors during build', async () => {
expect(buildOutput).toMatch(
/error.*The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'\?/
)
expect(buildOutput).toMatch(
/error.*The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'\?/
)
expect(buildOutput).toMatch(
/warn.*The tag 'amp-video extension \.js script' is missing/
)
}) })
it('should export AMP pages', async () => { it('should export AMP pages', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment