@@ -4,18 +4,7 @@ import process from 'process'
4
4
5
5
import type { NetlifyPluginOptions } from '@netlify/build'
6
6
import Chance from 'chance'
7
- import {
8
- writeJSON ,
9
- unlink ,
10
- existsSync ,
11
- readFileSync ,
12
- ensureDir ,
13
- readJson ,
14
- pathExists ,
15
- writeFile ,
16
- move ,
17
- copy ,
18
- } from 'fs-extra'
7
+ import { writeJSON , unlink , existsSync , readFileSync , ensureDir , readJson , pathExists , writeFile , move } from 'fs-extra'
19
8
import { join , relative } from 'pathe'
20
9
import { dir as getTmpDir } from 'tmp-promise'
21
10
@@ -86,9 +75,7 @@ let cleanup
86
75
// In each test, we change cwd to a temporary directory.
87
76
// This allows us not to have to mock filesystem operations.
88
77
beforeEach ( async ( ) => {
89
- const baseTmpDir = path . join ( __dirname , '..' , 'tmp' )
90
- await ensureDir ( baseTmpDir )
91
- const tmpDir = await getTmpDir ( { unsafeCleanup : true , tmpdir : baseTmpDir } )
78
+ const tmpDir = await getTmpDir ( { unsafeCleanup : true } )
92
79
restoreCwd = changeCwd ( tmpDir . path )
93
80
cleanup = tmpDir . cleanup
94
81
@@ -537,9 +524,6 @@ describe('onBuild()', () => {
537
524
const dir = 'web/.next'
538
525
await moveNextDist ( dir )
539
526
540
- // node_modules need to be in same relative position to .next, so it also needs to go one level deep
541
- await copy ( path . join ( __dirname , '..' , 'node_modules' ) , path . join ( __dirname , '..' , 'tmp' , 'node_modules' ) )
542
-
543
527
netlifyConfig . build . publish = path . resolve ( dir )
544
528
const config = {
545
529
...defaultArgs ,
0 commit comments