2020-06-11 17:59:11 +02:00
|
|
|
// What this script does:
|
|
|
|
// 1. Removes the old test folder if it exists (.budibase-cypress)
|
|
|
|
// 2. Initialises using `.budibase-cypress`
|
|
|
|
// 3. Runs the server using said folder
|
|
|
|
|
2020-06-11 18:14:28 +02:00
|
|
|
const rimraf = require("rimraf")
|
2020-06-11 21:37:01 +02:00
|
|
|
const { join } = require("path")
|
|
|
|
const homedir = join(require("os").homedir(), ".budibase-cypress")
|
|
|
|
const init = require("../../cli/src/commands/init/initHandler")
|
|
|
|
const run = require("../../cli/src/commands/run/runHandler")
|
2020-06-11 17:59:11 +02:00
|
|
|
|
2020-06-11 18:10:53 +02:00
|
|
|
rimraf.sync(homedir)
|
2020-06-11 17:59:11 +02:00
|
|
|
|
2020-06-21 21:54:37 +02:00
|
|
|
init({ dir: homedir, clientId: "cypress-test" })
|
2020-06-11 21:37:01 +02:00
|
|
|
.then(() => {
|
|
|
|
run({ dir: homedir })
|
|
|
|
})
|