Commit a50a0577 authored by Joe Haddad's avatar Joe Haddad Committed by JJ Kasper

Fix Tests (#9963)

parent 5a2182e6
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
"postcss-trolling": "0.1.7", "postcss-trolling": "0.1.7",
"pre-commit": "1.2.2", "pre-commit": "1.2.2",
"prettier": "1.19.1", "prettier": "1.19.1",
"react": "16.10.2", "react": "16.12.0",
"react-dom": "16.10.2", "react-dom": "16.12.0",
"react-ssr-prepass": "1.0.8", "react-ssr-prepass": "1.0.8",
"release": "6.0.1", "release": "6.0.1",
"request-promise-core": "1.1.2", "request-promise-core": "1.1.2",
...@@ -100,11 +100,13 @@ ...@@ -100,11 +100,13 @@
"tree-kill": "1.2.1", "tree-kill": "1.2.1",
"typescript": "3.7.3", "typescript": "3.7.3",
"wait-port": "0.2.2", "wait-port": "0.2.2",
"webpack-bundle-analyzer": "3.3.2" "webpack-bundle-analyzer": "3.3.2",
"browserslist": "^4.8.3",
"caniuse-lite": "^1.0.30001019"
}, },
"resolutions": { "resolutions": {
"browserslist": "^4.7.1", "browserslist": "^4.8.3",
"caniuse-lite": "^1.0.30001002" "caniuse-lite": "^1.0.30001019"
}, },
"engines": { "engines": {
"node": ">= 8.0.0" "node": ">= 8.0.0"
......
...@@ -2,7 +2,7 @@ import { getRouteRegex } from './route-regex' ...@@ -2,7 +2,7 @@ import { getRouteRegex } from './route-regex'
export function getRouteMatcher(routeRegex: ReturnType<typeof getRouteRegex>) { export function getRouteMatcher(routeRegex: ReturnType<typeof getRouteRegex>) {
const { re, groups } = routeRegex const { re, groups } = routeRegex
return (pathname: string | undefined) => { return (pathname: string | null | undefined) => {
const routeMatch = re.exec(pathname!) const routeMatch = re.exec(pathname!)
if (!routeMatch) { if (!routeMatch) {
return false return false
......
...@@ -11,7 +11,7 @@ export default (customRoute = false) => { ...@@ -11,7 +11,7 @@ export default (customRoute = false) => {
decode: decodeParam, decode: decodeParam,
}) })
return (pathname: string | undefined, params?: any) => { return (pathname: string | null | undefined, params?: any) => {
const res = pathname == null ? false : matcher(pathname) const res = pathname == null ? false : matcher(pathname)
if (!res) { if (!res) {
return false return false
......
...@@ -6,7 +6,7 @@ export const route = pathMatch() ...@@ -6,7 +6,7 @@ export const route = pathMatch()
export type Params = { [param: string]: any } export type Params = { [param: string]: any }
export type RouteMatch = (pathname: string | undefined) => false | Params export type RouteMatch = (pathname: string | null | undefined) => false | Params
type RouteResult = { type RouteResult = {
finished: boolean finished: boolean
......
...@@ -171,8 +171,8 @@ ...@@ -171,8 +171,8 @@
"@types/mkdirp": "0.5.2", "@types/mkdirp": "0.5.2",
"@types/nanoid": "2.0.0", "@types/nanoid": "2.0.0",
"@types/node-fetch": "2.3.4", "@types/node-fetch": "2.3.4",
"@types/react": "16.8.18", "@types/react": "16.9.17",
"@types/react-dom": "16.9.3", "@types/react-dom": "16.9.4",
"@types/react-is": "16.7.1", "@types/react-is": "16.7.1",
"@types/resolve": "0.0.8", "@types/resolve": "0.0.8",
"@types/send": "0.14.4", "@types/send": "0.14.4",
......
...@@ -101,7 +101,7 @@ describe('Production response size', () => { ...@@ -101,7 +101,7 @@ describe('Production response size', () => {
) )
// These numbers are without gzip compression! // These numbers are without gzip compression!
const delta = responseSizeKilobytes - 198 const delta = responseSizeKilobytes - 196
expect(delta).toBeLessThanOrEqual(0) // don't increase size expect(delta).toBeLessThanOrEqual(0) // don't increase size
expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target
}) })
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment