Skip to content

Commit ea07d97

Browse files
authored
Merge pull request #34 from netlify/chore/test-fixtures
2 parents 4ceb71f + b31cf24 commit ea07d97

File tree

12 files changed

+76
-53
lines changed

12 files changed

+76
-53
lines changed

__mocks__/cpx.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

__mocks__/make-dir.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

__mocks__/makef.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

__mocks__/next-on-netlify.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
const fs = require('fs')
12
const path = require('path')
3+
const util = require('util')
4+
25
const nextOnNetlify = require('next-on-netlify')
36
const { PHASE_PRODUCTION_BUILD } = require('next/constants')
47
const { default: loadConfig } = require('next/dist/next-server/server/config')
5-
const makef = require('makef')
68
const makeDir = require('make-dir')
79
const pathExists = require('path-exists')
810
const cpx = require('cpx')
11+
912
const isStaticExportProject = require('./helpers/isStaticExportProject')
1013

14+
const pWriteFile = util.promisify(fs.writeFile)
15+
1116
// * Helpful Plugin Context *
1217
// - Between the prebuild and build steps, the project's build command is run
1318
// - Between the build and postbuild steps, any functions are bundled
@@ -64,7 +69,7 @@ module.exports = {
6469
target: 'serverless'
6570
}
6671
`
67-
makef.createFile({ 'next.config.js': nextConfig })
72+
await pWriteFile('next.config.js', nextConfig)
6873
console.log(`** Adding next.config.js with target set to 'serverless' **`)
6974
}
7075
},

package-lock.json

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"dependencies": {
2727
"cpx": "^1.5.0",
2828
"make-dir": "^3.1.0",
29-
"makef": "^1.0.0",
3029
"next": "^9.5.3",
3130
"next-on-netlify": "^2.6.0",
3231
"path-exists": "^4.0.0"
@@ -35,10 +34,10 @@
3534
"@netlify/eslint-config-node": "^0.3.0",
3635
"husky": "^4.3.0",
3736
"jest": "^26.6.1",
38-
"mock-fs": "^4.13.0",
3937
"prettier": "^2.1.2",
4038
"react": "^17.0.1",
41-
"react-dom": "^17.0.1"
39+
"react-dom": "^17.0.1",
40+
"tmp-promise": "^3.0.2"
4241
},
4342
"husky": {
4443
"hooks": {
@@ -47,7 +46,8 @@
4746
},
4847
"jest": {
4948
"testMatch": [
50-
"**/test/**/*.js"
49+
"**/test/**/*.js",
50+
"!**/test/fixtures/**"
5151
],
5252
"verbose": true
5353
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
target: 'server',
3+
}

test/fixtures/publish_copy_files/out_publish/subdir/dummy.txt

Whitespace-only changes.

test/fixtures/publish_copy_files/publish/subdir/dummy.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)