Skip to content

Commit

Permalink
test: Create a @sku-private/test-utils package (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
askoufis committed Mar 21, 2023
1 parent 54eec3b commit 0b9cc36
Show file tree
Hide file tree
Showing 45 changed files with 228 additions and 351 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"overrides": [
{
"files": ["test/**", "tests/**"],
"files": ["tests/**", "test-utils/**"],
"env": {
"jest": true
},
Expand Down
1 change: 1 addition & 0 deletions fixtures/braid-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@sku-fixtures/braid-design-system",
"private": true,
"dependencies": {
"@sku-private/test-utils": "workspace:*",
"braid-design-system": "^31.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down
4 changes: 2 additions & 2 deletions fixtures/braid-design-system/sku.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ListExternalsPlugin = require('../../test/utils/ListExternalsWebpackPlugin');
const { ListExternalsWebpackPlugin } = require('@sku-private/test-utils');

module.exports = {
sites: [
Expand All @@ -10,7 +10,7 @@ module.exports = {
persistentCache: false,
dangerouslySetWebpackConfig: (config) => {
if (config.name === 'render') {
config.plugins.push(new ListExternalsPlugin());
config.plugins.push(new ListExternalsWebpackPlugin());
}

// Addresses an issue with this specific test suite where module IDs
Expand Down
1 change: 1 addition & 0 deletions fixtures/seek-style-guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@sku-fixtures/seek-style-guide",
"private": true,
"dependencies": {
"@sku-private/test-utils": "workspace:*",
"dedent": "^0.7.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down
4 changes: 2 additions & 2 deletions fixtures/seek-style-guide/sku.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const ListExternalsPlugin = require('../../test/utils/ListExternalsWebpackPlugin');
const { ListExternalsWebpackPlugin } = require('@sku-private/test-utils');

module.exports = {
storybookPort: 8083,
dangerouslySetWebpackConfig: (config) => {
if (config.name === 'render') {
config.plugins.push(new ListExternalsPlugin());
config.plugins.push(new ListExternalsWebpackPlugin());
}

return config;
Expand Down
1 change: 1 addition & 0 deletions fixtures/sku-with-https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@sku-fixtures/sku-with-https",
"private": true,
"dependencies": {
"@sku-private/test-utils": "workspace:*",
"dedent": "^0.7.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/sku-with-https/sku-server.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ListExternalsWebpackPlugin = require('../../test/utils/ListExternalsWebpackPlugin');
const { ListExternalsWebpackPlugin } = require('@sku-private/test-utils');

module.exports = {
clientEntry: 'src/serverClient.js',
Expand Down
2 changes: 1 addition & 1 deletion fixtures/sku-with-https/sku.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ListExternalsWebpackPlugin = require('../../test/utils/ListExternalsWebpackPlugin');
const { ListExternalsWebpackPlugin } = require('@sku-private/test-utils');

module.exports = {
port: 9843,
Expand Down
3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/** @type {import('jest').Config} */
module.exports = {
preset: 'jest-puppeteer',
setupFilesAfterEnv: ['<rootDir>/test/utils/jestSetup.js'],
setupFilesAfterEnv: ['<rootDir>/test-utils/jestSetup.js'],
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/scripts/test.js',
'<rootDir>/test/.*/src',
'<rootDir>/fixtures/.*/src',
],
watchPlugins: [
Expand Down
12 changes: 2 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"lint": "pnpm format-check && eslint --cache .",
"check": "pnpm install --frozen-lockfile && echo 'Ignore paths from lint-staged'",
"test": "SKU_TELEMETRY=false SKU_DISABLE_CACHE=true SKU_FORCE_EXIT=true OPEN_TAB=false jest --verbose",
"test-manual": "SKU_TELEMETRY=false node test/manual",
"setup-test-hosts": "node test/utils/setupTestHosts",
"setup-test-hosts": "node test-utils/setupTestHosts",
"format": "prettier --write '**/*.{js,ts,tsx,md,less,css}'",
"format-check": "prettier --list-different '**/*.{js,ts,tsx,md,less,css}'",
"postinstall": "node ./scripts/postinstall.js",
Expand Down Expand Up @@ -124,7 +123,6 @@
"html-render-webpack-plugin": "^3.0.1",
"identity-obj-proxy": "^3.0.0",
"indent-string": "^4.0.0",
"inquirer": "^8.2.3",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
"jest-watch-typeahead": "^2.2.0",
Expand Down Expand Up @@ -177,13 +175,9 @@
"@vanilla-extract/css": "^1.0.0",
"@vocab/react": "^1.0.1",
"assert": "^2.0.0",
"async-disk-cache": "^2.1.0",
"braid-design-system": "^31.0.0",
"child-process-promise": "^2.2.1",
"css": "^3.0.0",
"diffable-html": "^4.0.0",
"gh-pages": "^3.1.0",
"git-diff": "^2.0.6",
"html-webpack-plugin": "^5.3.2",
"husky": "^4.3.8",
"jest-puppeteer": "^7.0.0",
Expand All @@ -196,9 +190,7 @@
"react-router-dom": "^5.2.0",
"renovate-config-seek": "^0.4.0",
"seek-style-guide": "^42.0.0",
"wait-on": "^5.2.1",
"webpack-cli": "^5.0.0",
"webpack-stats-plugin": "^1.0.3"
"webpack-cli": "^5.0.0"
},
"volta": {
"node": "16.19.0"
Expand Down

0 comments on commit 0b9cc36

Please sign in to comment.