Skip to content

Commit

Permalink
Fix Cypress test default project folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lfdebrux committed Sep 29, 2022
1 parent 3624bff commit 5f4b887
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// the project's config changing)
const fs = require('fs')
const fsp = fs.promises
const os = require('os')
const path = require('path')

const waitOn = require('wait-on')
Expand Down Expand Up @@ -57,8 +58,10 @@ module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config

config.env.projectFolder = path.resolve(process.env.KIT_TEST_DIR || process.cwd())
config.env.tempFolder = path.join(__dirname, '..', 'temp')
config.env.tempFolder = path.resolve(os.tmpdir(), 'cypress', 'temp')
config.env.projectFolder = process.env.KIT_TEST_DIR
? path.resolve(process.env.KIT_TEST_DIR)
: path.resolve(os.tmpdir(), 'cypress', 'test-project')

const packagePath = path.join(config.env.projectFolder, 'package.json')
const packageContent = fs.readFileSync(packagePath, 'utf8')
Expand Down
3 changes: 1 addition & 2 deletions cypress/scripts/run-starter-prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const path = require('path')

const { mkPrototype, startPrototype, installExtensions, npmInstall } = require('../../__tests__/util')

const defaultKitPath = path.join(os.tmpdir(), 'cypress/temp/test-project')

const defaultKitPath = path.join(os.tmpdir(), 'cypress', 'test-project')
const testDir = path.resolve(process.env.KIT_TEST_DIR || defaultKitPath)

;(async () => {
Expand Down

0 comments on commit 5f4b887

Please sign in to comment.