1
-
2
1
import os from 'os'
3
2
import path , { resolve } from 'path'
4
3
import process from 'process'
5
4
6
5
import type { NetlifyPluginOptions } from '@netlify/build'
7
6
import Chance from 'chance'
8
7
import { writeJSON , unlink , existsSync , readFileSync , ensureDir , readJson , pathExists , writeFile , move } from 'fs-extra'
9
- import { join , relative } from 'pathe'
8
+ import { join , relative } from 'pathe'
10
9
import { dir as getTmpDir } from 'tmp-promise'
11
10
12
11
// @ts -expect-error - TODO: Convert runtime export to ES6
@@ -20,9 +19,9 @@ import { getAllPageDependencies } from '../packages/runtime/src/templates/getPag
20
19
import { changeCwd , useFixture , moveNextDist } from './test-utils'
21
20
22
21
jest . mock ( '../packages/runtime/src/helpers/utils' , ( ) => ( {
23
- ...jest . requireActual ( '../packages/runtime/src/helpers/utils' ) ,
24
- isNextAuthInstalled : jest . fn ( ) ,
25
- } ) )
22
+ ...jest . requireActual ( '../packages/runtime/src/helpers/utils' ) ,
23
+ isNextAuthInstalled : jest . fn ( ) ,
24
+ } ) )
26
25
27
26
jest . mock ( '../packages/runtime/src/helpers/functionsMetaData' , ( ) => {
28
27
const { NEXT_PLUGIN_NAME } = require ( '../packages/runtime/src/constants' )
@@ -322,7 +321,9 @@ describe('onBuild()', () => {
322
321
const failBuild = jest . fn ( ) . mockImplementation ( ( err ) => {
323
322
throw new Error ( err )
324
323
} )
325
- await expect ( ( ) => nextRuntime . onBuild ( { ...defaultArgs , utils : { ...utils , build : { failBuild } } } ) ) . rejects . toThrow (
324
+ await expect ( ( ) =>
325
+ nextRuntime . onBuild ( { ...defaultArgs , utils : { ...utils , build : { failBuild } } } ) ,
326
+ ) . rejects . toThrow (
326
327
`In most cases it should be set to ".next", unless you have chosen a custom "distDir" in your Next config.` ,
327
328
)
328
329
expect ( failBuild ) . toHaveBeenCalled ( )
@@ -336,9 +337,9 @@ describe('onBuild()', () => {
336
337
} )
337
338
netlifyConfig . build . publish = path . resolve ( 'out' )
338
339
339
- await expect ( ( ) => nextRuntime . onBuild ( { ... defaultArgs , utils : { ... utils , build : { failBuild } } } ) ) . rejects . toThrow (
340
- `Your publish directory is set to "out", but in most cases it should be ".next".` ,
341
- )
340
+ await expect ( ( ) =>
341
+ nextRuntime . onBuild ( { ... defaultArgs , utils : { ... utils , build : { failBuild } } } ) ,
342
+ ) . rejects . toThrow ( `Your publish directory is set to "out", but in most cases it should be ".next".` )
342
343
expect ( failBuild ) . toHaveBeenCalled ( )
343
344
} )
344
345
0 commit comments