return [pathOrCombined, options]
})
- const matchers: Array<
- RouteRecordMatcher & { _options: RegExpOptions }
- > = normalizedPaths
+ const matchers: Array<RouteRecordMatcher & {
+ _options: RegExpOptions
+ }> = normalizedPaths
.slice()
// Because sorting order is conserved, allows to mismatch order on
// routes with the same ranking
const BS_USER = process.env.BS_USER
const BS_KEY = process.env.BS_KEY
-function getKey (client) {
+function getKey(client) {
// const { capabilities, currentTest } = client
// originally i wanted to use this but it turns out the information changes
// on the afterEach, making the key non valid. But because every environment
return `${client.currentTest.module}: ${client.currentTest.name}`
}
-function shouldSkipBrowserstackReporting (client) {
+function shouldSkipBrowserstackReporting(client) {
return !BS_USER || !BS_KEY || client.options.selenium_port !== 80
}
* to every test suite. It cannot be added globably because these must be
* executed before each test (instead of each test suite as it does in globalModules)
*/
-module.exports = function sendStatus () {
+module.exports = function sendStatus() {
const sessionMap = Object.create(null)
return {
- beforeEach (browser, cb) {
+ beforeEach(browser, cb) {
// avoid running if missing credentials
if (shouldSkipBrowserstackReporting(this.client)) return cb()
// retrieve the session and save it to the map
})
},
- afterEach (browser, cb) {
+ afterEach(browser, cb) {
// avoid running if missing credentials
if (shouldSkipBrowserstackReporting(this.client)) return cb()
const key = getKey(this.client)
// change the name so it's easier to find
name: key,
status: 'failed',
- reason
+ reason,
},
{
auth: {
username: BS_USER,
- password: BS_KEY
- }
+ password: BS_KEY,
+ },
}
)
.catch(err => {
} else {
cb()
}
- }
+ },
}
}
"build": "yarn rollup -c rollup.config.js",
"dev": "webpack-dev-server --mode=development",
"dev:examples": "webpack-dev-server --mode=development --config examples/webpack.config.js",
- "lint": "prettier --write --parser typescript \"src/**/*.ts?(x)\"",
+ "lint": "prettier -c --parser typescript \"{src,__tests__,e2e}/**/*.[jt]s?(x)\"",
+ "lint:fix": "yarn run lint --write",
"test:types": "tsc --build tsconfig.json",
"test:unit": "jest --coverage",
"test": "yarn run test:types && yarn run test:unit && yarn build"
)
const beforeGuards: NavigationGuard[] = []
const afterGuards: PostNavigationGuard[] = []
- let currentRoute: Readonly<
- RouteLocationNormalized
- > = START_LOCATION_NORMALIZED
- let pendingLocation: Readonly<
- RouteLocationNormalized
- > = START_LOCATION_NORMALIZED
+ let currentRoute: Readonly<RouteLocationNormalized> = START_LOCATION_NORMALIZED
+ let pendingLocation: Readonly<RouteLocationNormalized> = START_LOCATION_NORMALIZED
let onReadyCbs: OnReadyCallback[] = []
// TODO: should these be triggered before or after route.push().catch()
let errorHandlers: ErrorHandler[] = []
// User level location
export type RouteLocation =
| string
- | RouteQueryAndHash & LocationAsPath & RouteLocationOptions
- | RouteQueryAndHash & LocationAsName & RouteLocationOptions
- | RouteQueryAndHash & LocationAsRelative & RouteLocationOptions
+ | (RouteQueryAndHash & LocationAsPath & RouteLocationOptions)
+ | (RouteQueryAndHash & LocationAsName & RouteLocationOptions)
+ | (RouteQueryAndHash & LocationAsRelative & RouteLocationOptions)
// A matched record cannot be a redirection and must contain
// a normalized version of components with { default: Component } instead of `component`