Files
next.js/test/examples/examples.test.ts
T
ccb8848bae test: remove deleted examples (#72374)
# Summary
Update
[`example.test.ts`](https://github.com/vercel/next.js/blob/canary/test/examples/examples.test.ts)
and
[`turbopack-dev-examples-manifest.json`](https://github.com/vercel/next.js/blob/canary/test/turbopack-dev-examples-manifest.json)
by removing deleted examples.

## Descriptions
[examples: cleanup #57845](https://github.com/vercel/next.js/pull/57845)
deleted ...

- amp-first
- amp-story
- data-fetch
- fast-refresh-demo
- hello-world-esm
- progressive-render
- using-router
- with-app-layout
- with-env-from-next-config-js
- with-loading

[updated the example of modularize-imports to utilize the App Router
#69771](https://github.com/vercel/next.js/pull/69771) deleted ...

- modularize-imports

[docs: Add docs on CSP and nonce generation
#54601](https://github.com/vercel/next.js/pull/54601/files) deleted ...

- styled-jsx-with-csp

[Updated the example of with-draft-js to utilize the App Router.
#70045](https://github.com/vercel/next.js/pull/70045) deleted ...

- with-draft-js

[Remove deprecated library example
#62813](https://github.com/vercel/next.js/pull/62813) deleted ...

- with-react-with-styles

[Remove with-reasonml-todo example
#62812](https://github.com/vercel/next.js/pull/62812/files) deleted ...

- with-reasonml-todo

[Remove with-semantic-ui example
#62811](https://github.com/vercel/next.js/pull/62811/files) deleted ...

- with-semantic-ui

[Updated the example of with-vercel-fetch to utilize the App Router.
#70069](https://github.com/vercel/next.js/pull/70069) deleted ...

- with-vercel-fetch

Co-authored-by: JJ Kasper <[email protected]>
2024-11-07 22:21:12 +00:00

89 lines
2.2 KiB
TypeScript

import { nextTestSetup } from 'e2e-utils'
import path from 'path'
import fs from 'fs-extra'
const testedExamples = [
// Internal features
'active-class-name',
'amp',
'api-routes-cors',
'api-routes-middleware',
'api-routes-rate-limit',
'api-routes-rest',
'app-dir-i18n-routing',
'app-dir-mdx',
'basic-css',
'basic-export',
'blog',
'blog-starter',
'catch-all-routes',
'custom-routes-proxying',
'custom-server',
'dynamic-routing',
'environment-variables',
'head-elements',
'headers',
'hello-world',
'i18n-routing',
'image-component',
'image-legacy-component',
'layout-component',
'middleware',
'middleware-matcher',
'nested-components',
'next-css',
'next-forms',
'redirects',
'remove-console',
'reproduction-template',
'rewrites',
'route-handlers',
'script-component',
'ssr-caching',
'svg-components',
'with-absolute-imports',
'with-context-api',
'with-shallow-routing',
'with-sitemap',
'with-typescript',
'with-typescript-types',
'with-web-worker',
'with-webassembly',
// Library integrations that we can't break
'with-jest',
'with-jest-babel',
'with-mdx',
'with-mdx-remote',
'with-turbopack',
]
describe.each(testedExamples)(`example '%s'`, (example) => {
// If there is an issue during a build, jest won't tell us which example caused it
// we need to log it ourselfs
beforeAll(() => {
require('console').log(`Running example '${example}'`)
})
const exampleFiles = path.join(__dirname, '..', '..', 'examples', example)
const packageJson = fs.readJsonSync(path.join(exampleFiles, 'package.json'))
describe(`example '${example}'`, () => {
nextTestSetup({
files: exampleFiles,
dependencies: {
// We need to make sure that these default dependencies are not installed by default
// for our examples to ensure that they have all their dependencies in package.json
'@types/node': undefined,
'@types/react': undefined,
next: undefined,
react: undefined,
'react-dom': undefined,
typescript: undefined,
...packageJson.dependencies,
...packageJson.devDependencies,
},
})
it('builds', () => {})
})
})