Files
Jiachi LiuandGitHub 8d28d5954e test: rename node_modules_bak to node_modules (#62066)
We switched to `pnpm` for testing instead of `yarn` for e2e tests
containing customized node_modules packages, it works with
`node_modules` folder before. Rename the existing `node_modules_bak`
hack to make it easy to test with.

Previously we use `yarn` but it will clean `node_modules` folder so we
have to use another script to copy packages, it's not a required thing
now so we can test package from node_modules directly without renaming
folders locally

Closes NEXT-2496
2024-02-15 00:42:35 +01:00

43 lines
1.1 KiB
TypeScript

import { createNextDescribe } from 'e2e-utils'
createNextDescribe(
'styled-jsx',
{
files: __dirname,
skipDeployment: true,
dependencies: {
'styled-jsx': '5.0.0', // styled-jsx on user side
},
},
({ next }) => {
it('should contain styled-jsx styles during SSR', async () => {
const html = await next.render('/')
expect(html).toMatch(/color:.*?red/)
expect(html).toMatch(/color:.*?cyan/)
})
it('should render styles during CSR', async () => {
const browser = await next.browser('/')
const color = await browser.eval(
`getComputedStyle(document.querySelector('button')).color`
)
expect(color).toMatch('0, 255, 255')
})
it('should render styles during CSR (AMP)', async () => {
const browser = await next.browser('/amp')
const color = await browser.eval(
`getComputedStyle(document.querySelector('button')).color`
)
expect(color).toMatch('0, 255, 255')
})
it('should render styles during SSR (AMP)', async () => {
const html = await next.render('/amp')
expect(html).toMatch(/color:.*?cyan/)
})
}
)