rendering.test.ts
Calls JavaScript readFile APIJavaScript comment contains a URL
SHA-2563b59c3e9135dcf0a2f82ec0770eb16cefe996b266326682ce56f79a8a77de257
MaleculeH₂(Cm₃F)
Evidence
1import { retry } from 'next-test-utils'
2import { nextTestSetup } from 'e2e-utils'
3
4describe('Document and App - Rendering via HTTP', () => {
5 const { next, isNextDev } = nextTestSetup({
6 files: __dirname,
7 })
8
9 describe('_document', () => {
10 it('should include required elements in rendered html', async () => {
11 const $ = await next.render$('/')
12 // It has a custom html class
13 expect($('html').hasClass('test-html-props')).toBe(true)
14 // It has a custom body class
15 exp …
47 })
48 })
49
50 it('renders ctx.renderPage with enhancer correctly', async () => {
51 const $ = await next.render$('/?withEnhancer=true')
52 …
105:23… -app').text()).toBe('Hello App')
106 })
107
108 // For example react context uses shared module state
109 // Also known as singleton modules
110 it('s …
116:63… alProps', async () => {
117 const errMsg = 'have an error from _app getInitialProps'
118 const origContent = await next.readFile('pages/_app.js')
119
120 expect(await next.render('/')).toContain('page-index')
⋯7 lines