Commit 58417412 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

build: tighten tsconfig (to include build cache, exclude watch folders) (#6375)

* build: extend cypress tsconfig from build tsconfig

* build: exclude node_modules from watch to improve typechecking perf

* fix: even tighter tsconfigs

* fix: even tighter

* fix: tailor cypress tsconfig to testing

* fix: split them up again

* fix: pr comments
parent cd3cff02
import { defineConfig } from 'cypress'
export default defineConfig({
projectId: 'yp82ef',
e2e: {
specPattern: 'cypress/release.ts',
},
})
import assert = require('assert') import assert from 'assert'
describe('Service Worker', () => { describe('Service Worker', () => {
before(() => { before(() => {
......
const ONE_MINUTE = 60_000
describe(
'Release',
{
pageLoadTimeout: ONE_MINUTE,
retries: 30,
},
() => {
it('loads swap page', () => {
// TODO: We *must* wait in order to space out the retry attempts. Find a better way to do this.
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(ONE_MINUTE)
.visit('/', {
retryOnStatusCodeFailure: true,
retryOnNetworkFailure: true,
})
.get('#swap-page')
})
}
)
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
// *********************************************************** // ***********************************************************
// Import commands.ts using ES2015 syntax: // Import commands.ts using ES2015 syntax:
import { injected } from './ethereum'
import assert = require('assert')
import '@cypress/code-coverage/support' import '@cypress/code-coverage/support'
import assert from 'assert'
import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags' import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags'
import { injected } from './ethereum'
declare global { declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace // eslint-disable-next-line @typescript-eslint/no-namespace
......
{ {
"compilerOptions": { "compilerOptions": {
"esModuleInterop": true,
"incremental": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"noEmit": true,
"strict": true, "strict": true,
"target": "es5", "target": "ES5",
"lib": ["es5", "dom"], "tsBuildInfoFile": "../node_modules/.cache/tsbuildinfo/cypress", // avoid clobbering the build tsbuildinfo
"types": ["cypress"] "types": ["cypress", "node"]
}, },
"include": ["**/*.ts"] "exclude": ["node_modules"],
"include": ["**/*.ts"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"analyze": "source-map-explorer 'build/static/js/*.js'", "analyze": "source-map-explorer 'build/static/js/*.js'",
"serve": "serve build -l 3000", "serve": "serve build -l 3000",
"lint": "yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ .", "lint": "yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ .",
"typecheck": "tsc --noEmit", "typecheck": "tsc",
"test": "craco test --coverage", "test": "craco test --coverage",
"test:size": "node scripts/test-size.js", "test:size": "node scripts/test-size.js",
"cypress:open": "cypress open --browser chrome --e2e", "cypress:open": "cypress open --browser chrome --e2e",
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"downlevelIteration": true, "downlevelIteration": true,
"esModuleInterop": true, "esModuleInterop": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "react-jsx", "jsx": "react-jsx",
"lib": ["DOM", "DOM.Iterable", "ESNext"], "lib": ["DOM", "DOM.Iterable", "ESNext"],
...@@ -25,10 +24,13 @@ ...@@ -25,10 +24,13 @@
"strict": true, "strict": true,
"strictNullChecks": true, "strictNullChecks": true,
"target": "ESNext", "target": "ESNext",
"tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo", "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo/build", // avoid clobbering the cypress tsbuildinfo
"types": ["jest"], "types": ["jest"],
"useUnknownInCatchVariables": false "useUnknownInCatchVariables": false
}, },
"exclude": ["node_modules", "cypress"], "exclude": ["node_modules"],
"include": ["src/**/*", "src/**/*.json"] "include": ["src/**/*", "src/**/*.json"],
"watchOptions": {
"excludeDirectories": ["node_modules"]
}
} }
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