Unverified Commit bbe8a9e1 authored by Sebastian Benz's avatar Sebastian Benz Committed by GitHub

Upgrade amp optimizer to v2.8.3 (#27106)

* upgrade amp optimizer to v2.8.3

* update lock

* update test
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 74162655
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
} }
}, },
"devDependencies": { "devDependencies": {
"@ampproject/toolbox-optimizer": "2.7.1-alpha.0", "@ampproject/toolbox-optimizer": "2.8.3",
"@babel/code-frame": "7.12.11", "@babel/code-frame": "7.12.11",
"@babel/core": "7.15.0", "@babel/core": "7.15.0",
"@babel/eslint-parser": "7.15.0", "@babel/eslint-parser": "7.15.0",
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ describe('AMP Custom Optimizer', () => { ...@@ -29,7 +29,7 @@ describe('AMP Custom Optimizer', () => {
) )
expect(html).toContain('i-amphtml-version="001515617716922"') expect(html).toContain('i-amphtml-version="001515617716922"')
expect(html).toContain( expect(html).toContain(
'script async src="https://cdn.ampproject.org/rtv/001515617716922/v0.js"' 'script async src="https://cdn.ampproject.org/rtv/001515617716922/v0.mjs"'
) )
}) })
...@@ -48,7 +48,7 @@ describe('AMP Custom Optimizer', () => { ...@@ -48,7 +48,7 @@ describe('AMP Custom Optimizer', () => {
) )
expect(html).toContain('i-amphtml-version="001515617716922"') expect(html).toContain('i-amphtml-version="001515617716922"')
expect(html).toContain( expect(html).toContain(
'script async src="https://cdn.ampproject.org/rtv/001515617716922/v0.js"' 'script async src="https://cdn.ampproject.org/rtv/001515617716922/v0.mjs"'
) )
}) })
}) })
...@@ -106,21 +106,6 @@ describe('AMP Usage', () => { ...@@ -106,21 +106,6 @@ describe('AMP Usage', () => {
expect(result).toBeFalsy() expect(result).toBeFalsy()
}) })
it('should add link preload for amp script', async () => {
const html = await renderViaHTTP(appPort, '/?amp=1')
await validateAMP(html)
const $ = cheerio.load(html)
expect(
$(
$('link[rel=preload]')
.toArray()
.find(
(i) => $(i).attr('href') === 'https://cdn.ampproject.org/v0.js'
)
).attr('href')
).toBe('https://cdn.ampproject.org/v0.js')
})
it('should drop custom scripts', async () => { it('should drop custom scripts', async () => {
const html = await renderViaHTTP(appPort, '/custom-scripts') const html = await renderViaHTTP(appPort, '/custom-scripts')
expect(html).not.toMatch(/src='\/im-not-allowed\.js'/) expect(html).not.toMatch(/src='\/im-not-allowed\.js'/)
......
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