Benign repos Download

index.test.ts

Imports the node-fetch HTTP clientimports node-fetch
SHA-256f901ad65ed739f3918f7ed9c4dea018312255ac5e011955ef4df7c2161a61a2c

Evidence

imports node-fetch lines 1–15
1/* eslint-env jest */
2
3import cheerio from 'cheerio'
4import { findPort, killApp, launchApp, renderViaHTTP } from 'next-test-utils'
5import webdriver from 'next-webdriver'
6import fetch from 'node-fetch'
7import { join } from 'path'
8
9const context = { output: '', appPort: -1, server: undefined }
10
11describe('Configuration', () => {
12 beforeAll(async () => {
13 context.output = ''
14
15 const handleOutp …
English function-word token "the" lines 19–28
⋯4 lines
23 })
24
25 // pre-build all pages at the start
26 await Promise.all([
27 renderViaHTTP(context.appPort, '/next-config'),
28 renderViaHTTP(context.appPort, '/ …
it() function call lines 33–53
⋯7 lines
40
41 it('should disable X-Powered-By header support', async () => {
42 const url = `http://localhost:${context.appPort}/`
43 const header = (await fetch(url)).headers.get('X-Powered-By')
44 expect(header).not.toBe('Next.js')
45 })
46
47 test('correctly imports a package that defines `module` but no `main` in package.json', async () => {
48 const $ = await get$('/module-only-content')
49 expect($('#messageInAPackage').text()).toBe('OK')
50 })
51
52 it('should have env variables available on the client', async () => {
53 const browser = await webdriver(conte …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.