diff --git a/frontend/lib/routes.ts b/frontend/lib/routes.ts index 05dbaade5..253177255 100644 --- a/frontend/lib/routes.ts +++ b/frontend/lib/routes.ts @@ -91,6 +91,7 @@ function createOnboardingRouteInfo(prefix: string) { * This namespace parallels our Routes object, providing useful types * related to specific routes. */ +/* export namespace RouteTypes { export namespace onboarding { export namespace forIntent { @@ -98,6 +99,7 @@ export namespace RouteTypes { } } } +*/ /** * This is an ad-hoc structure that defines URL routes for our app. diff --git a/jest.config.js b/jest.config.js index 576495ec1..9aedc2785 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,12 +3,14 @@ const path = require('path'); module.exports = { "testURL": "http://localhost", "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.tsx?$": "./jest.transform.js" }, "roots": [ "frontend" ], - "collectCoverage": true, + // We need to disable coverage to avoid the following issue: + // https://github.com/istanbuljs/istanbuljs/issues/237 + "collectCoverage": false, "coveragePathIgnorePatterns": [ "/node_modules/", "safe-mode-globals.d.ts", diff --git a/jest.transform.js b/jest.transform.js new file mode 100644 index 000000000..0f61d041d --- /dev/null +++ b/jest.transform.js @@ -0,0 +1,17 @@ +module.exports = require('babel-jest').createTransformer({ + presets: [ + ['@babel/preset-env', { + targets: { + "node": "current" + } + }], + '@babel/preset-typescript', + '@babel/preset-react', + ], + plugins: [ + ["@babel/plugin-proposal-decorators", { "legacy": true }], + '@babel/plugin-proposal-class-properties', + "@babel/plugin-syntax-dynamic-import", + "babel-plugin-dynamic-import-node-babel-7", + ] +}); diff --git a/package-lock.json b/package-lock.json index b96e8a39d..a113fd403 100644 --- a/package-lock.json +++ b/package-lock.json @@ -230,6 +230,20 @@ "@babel/types": "^7.0.0" } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.3.4.tgz", + "integrity": "sha512-uFpzw6L2omjibjxa8VGZsJUPL5wJH0zzGKpoz0ccBkzIa6C8kWNUbiBmQ0rgOKWlHJ6qzmfa6lTiGchiV8SC+g==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.3.4", + "@babel/helper-split-export-declaration": "^7.0.0" + } + }, "@babel/helper-define-map": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz", @@ -469,6 +483,27 @@ "@babel/plugin-syntax-async-generators": "^7.2.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.3.4.tgz", + "integrity": "sha512-lUf8D3HLs4yYlAo8zjuneLvfxN7qfKv1Yzbj5vjqaqMJxgJA3Ipwp4VUJ+OrOdz53Wbww6ahwB8UhB2HQyLotA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.3.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-proposal-decorators": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.3.0.tgz", + "integrity": "sha512-3W/oCUmsO43FmZIqermmq6TKaRSYhmh/vybPfVFwQWdSb8xwki38uAIvknCRzuyHRuYfCYmJzL9or1v0AffPjg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.3.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-decorators": "^7.2.0" + } + }, "@babel/plugin-proposal-json-strings": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", @@ -547,6 +582,15 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-decorators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz", + "integrity": "sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", @@ -587,6 +631,15 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", + "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", @@ -817,6 +870,14 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-transform-react-display-name": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", + "integrity": "sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-transform-react-jsx": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz", @@ -827,6 +888,24 @@ "@babel/plugin-syntax-jsx": "^7.2.0" } }, + "@babel/plugin-transform-react-jsx-self": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz", + "integrity": "sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@babel/plugin-transform-react-jsx-source": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz", + "integrity": "sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, "@babel/plugin-transform-regenerator": { "version": "7.3.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.3.4.tgz", @@ -887,6 +966,16 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-transform-typescript": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.3.2.tgz", + "integrity": "sha512-Pvco0x0ZSCnexJnshMfaibQ5hnK8aUHSvjCQhC1JR8eeg+iBwt0AtCO7gWxJ358zZevuf9wPSO5rv+WJcbHPXQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-typescript": "^7.2.0" + } + }, "@babel/plugin-transform-unicode-regex": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz", @@ -1018,6 +1107,28 @@ } } }, + "@babel/preset-react": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz", + "integrity": "sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0" + } + }, + "@babel/preset-typescript": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz", + "integrity": "sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.3.2" + } + }, "@babel/template": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", @@ -2480,7 +2591,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -3025,6 +3136,15 @@ } } }, + "babel-plugin-dynamic-import-node-babel-7": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node-babel-7/-/babel-plugin-dynamic-import-node-babel-7-2.0.7.tgz", + "integrity": "sha512-8DO7mdeczoxi0z1ggb6wS/yWkwM2F9uMPKsVeohK1Ff389JENDfZd+aINwM5r2p66IZGR0rkMrYCr2EyEGrGAQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.42" + } + }, "babel-plugin-istanbul": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz", @@ -3406,15 +3526,6 @@ "pako": "~1.0.5" } }, - "bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", - "dev": true, - "requires": { - "fast-json-stable-stringify": "2.x" - } - }, "bser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", @@ -5467,13 +5578,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5490,8 +5599,7 @@ }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", @@ -5620,7 +5728,6 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -11414,49 +11521,6 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", "dev": true }, - "ts-jest": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.0.tgz", - "integrity": "sha512-o8BO3TkMREpAATaFTrXkovMsCpBl2z4NDBoLJuWZcJJj1ijI49UnvDMfVpj+iogn/Jl8Pbhuei5nc/Ti+frEHw==", - "dev": true, - "requires": { - "bs-logger": "0.x", - "buffer-from": "1.x", - "fast-json-stable-stringify": "2.x", - "json5": "2.x", - "make-error": "1.x", - "mkdirp": "0.x", - "resolve": "1.x", - "semver": "^5.5", - "yargs-parser": "10.x" - }, - "dependencies": { - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, "ts-loader": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-4.5.0.tgz", @@ -11487,7 +11551,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } diff --git a/package.json b/package.json index 2682f5a74..3b492b22b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint": "tsc --noEmit", "lint:watch": "tsc --noEmit --watch --preserveWatchOutput", "test": "jest", - "test:watch": "jest --watch", + "test:watch": "jest --watch --no-cache", "sass": "node-sass frontend/sass/styles.scss frontend/static/frontend/styles.css --source-map frontend/static/frontend/styles.css.map --source-map-contents --output-style compressed", "sass:watch": "npm run sass -- --watch", "querybuilder:watch": "node querybuilder.js --watch", @@ -33,6 +33,9 @@ }, "homepage": "https://github.com/justfixnyc/tenants2#readme", "devDependencies": { + "@babel/plugin-proposal-class-properties": "^7.3.4", + "@babel/plugin-proposal-decorators": "^7.3.0", + "@babel/preset-typescript": "^7.3.3", "@types/chokidar": "1.7.5", "@types/dotenv": "4.0.3", "@types/enzyme": "3.1.14", @@ -42,6 +45,8 @@ "@types/webpack-bundle-analyzer": "2.13.0", "@types/webpack-node-externals": "1.6.3", "apollo": "2.5.1", + "babel-jest": "^24.1.0", + "babel-plugin-dynamic-import-node-babel-7": "^2.0.7", "chalk": "2.4.1", "chokidar": "2.0.4", "concurrently": "3.6.1", @@ -50,10 +55,16 @@ "enzyme-adapter-react-16": "1.6.0", "jest": "24.1.0", "react-testing-library": "5.2.3", - "ts-jest": "24.0.0", "webpack-bundle-analyzer": "2.13.1" }, "dependencies": { + "@babel/core": "7.3.4", + "@babel/plugin-proposal-object-rest-spread": "7.3.4", + "@babel/plugin-syntax-dynamic-import": "7.2.0", + "@babel/plugin-transform-react-jsx": "7.3.0", + "@babel/polyfill": "7.2.5", + "@babel/preset-env": "7.3.4", + "@babel/preset-react": "^7.0.0", "@types/cheerio": "0.22.9", "@types/classnames": "2.2.6", "@types/isomorphic-fetch": "0.0.34", @@ -69,13 +80,7 @@ "@types/smoothscroll-polyfill": "0.3.0", "@types/source-map-support": "0.4.1", "autobind-decorator": "2.1.0", - "@babel/core": "7.3.4", "babel-loader": "8.0.5", - "@babel/plugin-syntax-dynamic-import": "7.2.0", - "@babel/plugin-proposal-object-rest-spread": "7.3.4", - "@babel/plugin-transform-react-jsx": "7.3.0", - "@babel/polyfill": "7.2.5", - "@babel/preset-env": "7.3.4", "bulma": "0.7.2", "cheerio": "1.0.0-rc.2", "classnames": "2.2.6",