chore: keeps swc/register for playwright tests

This commit is contained in:
James
2023-01-10 15:53:41 -05:00
parent f1c342e05e
commit 441eb2c20c
3 changed files with 42 additions and 13 deletions

View File

@@ -37,7 +37,7 @@
"build": "yarn copyfiles && yarn build:tsc && yarn build:components",
"build:watch": "nodemon --watch 'src/**' --ext 'ts,tsx' --exec \"yarn build:tsc\"",
"dev": "nodemon",
"dev:generate-types": "node ./test/generateTypes.js",
"dev:generate-types": "ts-node ./test/generateTypes.js",
"pretest": "yarn build",
"test": "yarn test:int && yarn test:components && yarn test:e2e",
"test:int": "cross-env DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
@@ -191,9 +191,10 @@
"webpack-hot-middleware": "^2.25.0"
},
"devDependencies": {
"@playwright/test": "^1.23.1",
"@playwright/test": "^1.29.2",
"@release-it/conventional-changelog": "^5.1.1",
"@swc/jest": "^0.2.24",
"@swc/register": "^0.1.10",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^13.0.1",
"@trbl/eslint-config": "^1.2.4",

View File

@@ -1,4 +1,5 @@
import getPort from 'get-port';
import swcRegister from '@swc/register';
import path from 'path';
import { v4 as uuid } from 'uuid';
import shelljs from 'shelljs';
@@ -40,6 +41,19 @@ export async function initPayloadTest(options: Options): Promise<{ serverURL: st
initOptions.express = express();
}
swcRegister({
sourceMaps: 'inline',
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
},
module: {
type: 'commonjs',
},
});
await payload.init(initOptions);
if (initOptions.express) {

View File

@@ -1797,13 +1797,13 @@
dependencies:
"@octokit/openapi-types" "^14.0.0"
"@playwright/test@^1.23.1":
version "1.29.1"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.29.1.tgz#f2ed4dc143b9c7825a7ad2703b2f1ac4354e1145"
integrity sha512-iQxk2DX5U9wOGV3+/Jh9OHPsw5H3mleUL2S4BgQuwtlAfK3PnKvn38m4Rg9zIViGHVW24opSm99HQm/UFLEy6w==
"@playwright/test@^1.29.2":
version "1.29.2"
resolved "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz#c48184721d0f0b7627a886e2ec42f1efb2be339d"
integrity sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==
dependencies:
"@types/node" "*"
playwright-core "1.29.1"
playwright-core "1.29.2"
"@pnpm/network.ca-file@^1.0.1":
version "1.0.2"
@@ -1950,6 +1950,15 @@
"@jest/create-cache-key-function" "^27.4.2"
jsonc-parser "^3.2.0"
"@swc/register@^0.1.10":
version "0.1.10"
resolved "https://registry.npmjs.org/@swc/register/-/register-0.1.10.tgz#74a20b7559669e03479b05e9e5c6d1524d4d92a2"
integrity sha512-6STwH/q4dc3pitXLVkV7sP0Hiy+zBsU2wOF1aXpXR95pnH3RYHKIsDC+gvesfyB7jxNT9OOZgcqOp9RPxVTx9A==
dependencies:
lodash.clonedeep "^4.5.0"
pirates "^4.0.1"
source-map-support "^0.5.13"
"@szmarczak/http-timer@^5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a"
@@ -8070,6 +8079,11 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==
lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
@@ -9339,7 +9353,7 @@ pino@^6.4.1:
quick-format-unescaped "^4.0.3"
sonic-boom "^1.0.2"
pirates@^4.0.4:
pirates@^4.0.1, pirates@^4.0.4:
version "4.0.5"
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b"
integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==
@@ -9358,10 +9372,10 @@ pkg-up@^3.1.0:
dependencies:
find-up "^3.0.0"
playwright-core@1.29.1:
version "1.29.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.29.1.tgz#9ec15d61c4bd2f386ddf6ce010db53a030345a47"
integrity sha512-20Ai3d+lMkWpI9YZYlxk8gxatfgax5STW8GaMozAHwigLiyiKQrdkt7gaoT9UQR8FIVDg6qVXs9IoZUQrDjIIg==
playwright-core@1.29.2:
version "1.29.2"
resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.29.2.tgz#2e8347e7e8522409f22b244e600e703b64022406"
integrity sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==
pluralize@^8.0.0:
version "8.0.0"
@@ -11145,7 +11159,7 @@ source-map-support@0.5.13:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map-support@~0.5.20:
source-map-support@^0.5.13, source-map-support@~0.5.20:
version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==