Buckets:
| /* eslint-env jest */ | |
| import { transformSync } from '@babel/core' | |
| const babel = (code) => | |
| transformSync(code, { | |
| filename: 'page.tsx', | |
| presets: ['@babel/preset-typescript'], | |
| plugins: [require('next/dist/build/babel/plugins/next-page-config')], | |
| babelrc: false, | |
| configFile: false, | |
| sourceType: 'module', | |
| compact: true, | |
| caller: { | |
| name: 'tests', | |
| isDev: false, | |
| }, | |
| } as any).code | |
| describe('babel plugin (next-page-config)', () => { | |
| test('export config with type annotation', () => { | |
| const output = babel('export const config: PageConfig = {};') | |
| expect(output).toMatch(`export const config={};`) | |
| }) | |
| test('export config with AsExpression', () => { | |
| const output = babel('export const config = {} as PageConfig;') | |
| expect(output).toMatch('export const config={};') | |
| }) | |
| }) | |
Xet Storage Details
- Size:
- 839 Bytes
- Xet hash:
- 6e88728da6059e2e22f886e1167e55f48b8396270fa4a869b97cfa0c9a251f2e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.