const Nightwatch = require('nightwatch')
const args = process.argv.slice(2)
+// allow running browserstack local
+const isLocal = args.indexOf('--local') > -1
+
+if (isLocal && (!process.env.BS_USER || !process.env.BS_KEY)) {
+ console.log(
+ 'Hey!\n',
+ 'You are missing credentials for Browserstack.\n',
+ 'If you are a contributor, this is normal, credentials are private. These tests must be run by a maintainer of vue-router',
+ 'If you are a maintainer, make sure to create your `.env` file with both `BS_USER` and `BS_KEY` variables!'
+ )
+ // fail if testing locally
+ process.exit(process.env.CI ? 0 : 1)
+}
+
// if we are running yarn dev locally, we can pass --dev to avoid launching another server instance
const server =
args.indexOf('--dev') > -1
// ? require('./staticServer')
require('./devServer')
-// allow running browserstack local
-const isLocal = args.indexOf('--local') > -1
-
const DEFAULT_CONFIG = './nightwatch.json'
const NW_CONFIG = isLocal
? resolve(__dirname, './nightwatch.browserstack.js')
)
if (isLocal) {
- if (isLocal && (!process.env.BS_USER || !process.env.BS_KEY)) {
- console.log(
- 'Hey!\n',
- 'You are missing credentials for Browserstack.\n',
- 'If you are a contributor, this is normal, credentials are private. These tests must be run by a maintainer of vue-router',
- 'If you are a maintainer, make sure to create your `.env` file with both `BS_USER` and `BS_KEY` variables!'
- )
- // fail if testing locally
- process.exit(process.env.CI ? 0 : 1)
- }
-
let bsLocal
const browserstack = require('browserstack-local')
Nightwatch.bs_local = bsLocal = new browserstack.Local()
-import fs from 'fs'
-import { resolve, join } from 'path'
-import { defineConfig } from 'vite'
-import vue from '@vitejs/plugin-vue'
-import history from 'connect-history-api-fallback'
+const fs = require('fs')
+const { resolve, join } = require('path')
+const { defineConfig } = require('vite')
+const vue = require('@vitejs/plugin-vue')
+const history = require('connect-history-api-fallback')
/** @type {string[]} */
let examples = []