diff --git a/docs/README.md b/docs/README.md index a3321143aeb..2e0a11fc847 100644 --- a/docs/README.md +++ b/docs/README.md @@ -27,10 +27,19 @@ Note, if you're not using `nvm`, you'll need to set the environment variable: `e ### Test -- Run `yarn test` to test. -- If the snapshot test fails, run `yarn test -- -u`. +From the monorepo root run: -Test runs after build. +```sh +$ yarn docs test +``` + +#### Updating Props Table Snapshot + +To update the Props Table snapshot run: + +```sh +$ yarn docs test -u __tests__/props-table.test.ts +``` ### Creating a Page diff --git a/docs/tests/__snapshots__/cssvars-table.test.ts.snap b/docs/__tests__/__snapshots__/cssvars-table.test.ts.snap similarity index 100% rename from docs/tests/__snapshots__/cssvars-table.test.ts.snap rename to docs/__tests__/__snapshots__/cssvars-table.test.ts.snap diff --git a/docs/tests/__snapshots__/props-table.test.ts.snap b/docs/__tests__/__snapshots__/props-table.test.ts.snap similarity index 100% rename from docs/tests/__snapshots__/props-table.test.ts.snap rename to docs/__tests__/__snapshots__/props-table.test.ts.snap diff --git a/docs/tests/__snapshots__/sitemap.test.ts.snap b/docs/__tests__/__snapshots__/sitemap.test.ts.snap similarity index 100% rename from docs/tests/__snapshots__/sitemap.test.ts.snap rename to docs/__tests__/__snapshots__/sitemap.test.ts.snap diff --git a/docs/tests/cssvars-table.test.ts b/docs/__tests__/cssvars-table.test.ts similarity index 100% rename from docs/tests/cssvars-table.test.ts rename to docs/__tests__/cssvars-table.test.ts diff --git a/docs/tests/props-table.test.ts b/docs/__tests__/props-table.test.ts similarity index 100% rename from docs/tests/props-table.test.ts rename to docs/__tests__/props-table.test.ts diff --git a/docs/tests/sitemap.test.ts b/docs/__tests__/sitemap.test.ts similarity index 100% rename from docs/tests/sitemap.test.ts rename to docs/__tests__/sitemap.test.ts diff --git a/docs/tests/tsconfig.json b/docs/__tests__/tsconfig.json similarity index 100% rename from docs/tests/tsconfig.json rename to docs/__tests__/tsconfig.json diff --git a/docs/jest.config.ts b/docs/jest.config.ts index afb4599e45b..2948f649d8c 100644 --- a/docs/jest.config.ts +++ b/docs/jest.config.ts @@ -3,10 +3,7 @@ * https://jestjs.io/docs/configuration */ -export default { - collectCoverage: true, - coverageDirectory: 'coverage', - coverageProvider: 'v8', +const jestConfig = { preset: 'ts-jest', setupFiles: ['./jestEnv.ts'], transform: { @@ -14,3 +11,5 @@ export default { '^.+\\.(js|jsx)$': 'babel-jest', }, }; + +export default jestConfig; diff --git a/docs/package.json b/docs/package.json index 675d27a63be..838186f0df0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -64,7 +64,6 @@ }, "license": "MIT", "devDependencies": { - "@babel/preset-env": "^7.20.2", "@supercharge/promise-pool": "^2.4.0", "@types/jest": "^27", "@types/lodash": "^4.14.170", diff --git a/docs/tests/babel.config.js b/docs/tests/babel.config.js deleted file mode 100644 index 1f3f8801ede..00000000000 --- a/docs/tests/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { presets: ['@babel/preset-env'] }; diff --git a/yarn.lock b/yarn.lock index bfb2efbb519..10ae41b3108 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4914,7 +4914,7 @@ core-js-compat "^3.22.1" semver "^6.3.0" -"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.15.8", "@babel/preset-env@^7.17.10", "@babel/preset-env@^7.20.2", "@babel/preset-env@^7.4.5": +"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.15.8", "@babel/preset-env@^7.17.10", "@babel/preset-env@^7.4.5": version "7.21.4" resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.21.4.tgz#a952482e634a8dd8271a3fe5459a16eb10739c58" integrity sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw==