Skip to content

Commit beb5590

Browse files
committed
wip: updates to test paths, but things still aren’t working
1 parent 2b69f1f commit beb5590

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
"scripts": {
1111
"format": "prettier --write .",
1212
"build": "next build test/sample",
13-
"test": "npm run build && jest"
13+
"test": "npm run build && jest && jest --config src/tests/jest.config.js",
14+
"cypress:local": "env CYPRESS_DEPLOY=local cypress run --project ./src --config-file false --config video=false",
15+
"cypress:netlify": "env CYPRESS_DEPLOY=netlify cypress run --project ./src --config-file false --config video=false",
16+
"cypress:local:testonly": "env CYPRESS_SKIP_DEPLOY=true npm run cypress:local",
17+
"cypress:netlify:testonly": "env CYPRESS_SKIP_DEPLOY=true npm run cypress:netlify"
1418
},
1519
"repository": {
1620
"type": "git",

src/cypress/fixtures/pages-with-i18n/getStaticProps/withFallback/[id].js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const Show = ({ show }) => {
2929
}
3030

3131
export async function getStaticPaths() {
32+
const cfg = require('../../../next.config')
33+
console.log({ cfg })
3234
// Set the paths we want to pre-render
3335
const paths = [{ params: { id: '3' } }, { params: { id: '4' }, locale: 'fr' }]
3436

src/next-on-netlify.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
const { program } = require('commander')
3+
4+
const nextOnNetlify = require('./index')
5+
6+
program.option('--max-log-lines [number]', 'lines of build output to show for each section', 50)
7+
8+
program
9+
.command('watch')
10+
.description('re-runs next-on-netlify on changes')
11+
.action(() => {
12+
nextOnNetlify({ watch: true })
13+
})
14+
15+
program
16+
.command('build', { isDefault: true })
17+
.description('runs next-on-netlify')
18+
.action(() => {
19+
nextOnNetlify()
20+
})
21+
22+
program.parse(process.argv)

src/tests/helpers/nextVersion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { join } = require('path')
22
const { readJsonSync } = require('fs-extra')
33

4-
const NEXT_PATH = join(__dirname, '..', '..', 'node_modules', 'next')
4+
const NEXT_PATH = join(__dirname, '..', '..', '..', 'node_modules', 'next')
55
const { version: NEXT_VERSION } = readJsonSync(join(NEXT_PATH, 'package.json'))
66

77
module.exports = { NEXT_VERSION }

0 commit comments

Comments
 (0)