{
"name": "<name>",
"private": true,
"license": "UNLICENSED",
"version": "0.1.0",
"description": "<description>",
"author": "<authors>",
"keywords": [
"aws",
"<censored>",
"aws accounts",
"aws console",
"aws credentials"
],
"scripts": {
"build": "cross-env TARGET=chromium,firefox webpack --config webpack/webpack.config.js",
"format": "prettier . --write",
"format:check": "prettier . --check",
"package": "cross-env NODE_ENV=production TARGET=chromium,firefox PACKAGE_CRXS=true PACKAGE_XPIS=true webpack --config webpack/webpack.config.js",
"package:chrome": "cross-env NODE_ENV=production TARGET=chromium PACKAGE_CRXS=true webpack --config webpack/webpack.config.js",
"package:firefox": "cross-env NODE_ENV=production TARGET=firefox PACKAGE_CRXS=false PACKAGE_XPIS=true webpack --config webpack/webpack.config.js",
"test": "jest --silent"
},
"dependencies": {
"@cloudscape-design/collection-hooks": "^1.0.36",
"@cloudscape-design/components": "^3.0.529",
"@cloudscape-design/design-tokens": "^3.0.34",
"@cloudscape-design/global-styles": "^1.0.23",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-virtual": "^2.10.4"
},
"devDependencies": {
"@cloudscape-design/components-themeable": "^3.0.544",
"@cloudscape-design/jest-preset": "^2.0.28",
"@cloudscape-design/theming-build": "^1.0.51",
"@types/chrome": "^0.0.260",
"@types/firefox-webext-browser": "^120.0.0",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/react-test-renderer": "^18.0.7",
"archiver": "^6.0.1",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"crx": "^5.0.1",
"css-loader": "^6.10.0",
"git-revision-webpack-plugin": "^5.0.0",
"jest": "^29.7.0",
"merge": "^2.1.1",
"mkdirp": "^3.0.1",
"prettier": "3.2.5",
"react-test-renderer": "^18.2.0",
"sass": "^1.70.0",
"sass-loader": "^14.1.0",
"style-loader": "^3.3.4",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4"
},
"overrides": {
"react-virtual": {
"react": "$react"
}
}
}
Package version
2.0.28
Jest version
29.7.0
node-versions
20.9.0
npm-versions
10.2.3
Description
Hi 👋 This is my first frontend project in quite awhile, I was able to get the UI & styling working in the way I wanted. However, I'm now running into an error upon trying to actually write tests for these react components. Specifically jest gets an unexpected token even though I have setup the project according to the documentation as far as I can tell.
The exact error I'm getting is:
Source code
Although I can't share links directly to the code I can share the following snippets, please let me know if you need anymore:
pacakge.json
{ "name": "<name>", "private": true, "license": "UNLICENSED", "version": "0.1.0", "description": "<description>", "author": "<authors>", "keywords": [ "aws", "<censored>", "aws accounts", "aws console", "aws credentials" ], "scripts": { "build": "cross-env TARGET=chromium,firefox webpack --config webpack/webpack.config.js", "format": "prettier . --write", "format:check": "prettier . --check", "package": "cross-env NODE_ENV=production TARGET=chromium,firefox PACKAGE_CRXS=true PACKAGE_XPIS=true webpack --config webpack/webpack.config.js", "package:chrome": "cross-env NODE_ENV=production TARGET=chromium PACKAGE_CRXS=true webpack --config webpack/webpack.config.js", "package:firefox": "cross-env NODE_ENV=production TARGET=firefox PACKAGE_CRXS=false PACKAGE_XPIS=true webpack --config webpack/webpack.config.js", "test": "jest --silent" }, "dependencies": { "@cloudscape-design/collection-hooks": "^1.0.36", "@cloudscape-design/components": "^3.0.529", "@cloudscape-design/design-tokens": "^3.0.34", "@cloudscape-design/global-styles": "^1.0.23", "react": "^18.2.0", "react-dom": "^18.2.0", "react-virtual": "^2.10.4" }, "devDependencies": { "@cloudscape-design/components-themeable": "^3.0.544", "@cloudscape-design/jest-preset": "^2.0.28", "@cloudscape-design/theming-build": "^1.0.51", "@types/chrome": "^0.0.260", "@types/firefox-webext-browser": "^120.0.0", "@types/jest": "^29.5.12", "@types/react": "^18.2.55", "@types/react-dom": "^18.2.19", "@types/react-test-renderer": "^18.0.7", "archiver": "^6.0.1", "copy-webpack-plugin": "^12.0.2", "cross-env": "^7.0.3", "crx": "^5.0.1", "css-loader": "^6.10.0", "git-revision-webpack-plugin": "^5.0.0", "jest": "^29.7.0", "merge": "^2.1.1", "mkdirp": "^3.0.1", "prettier": "3.2.5", "react-test-renderer": "^18.2.0", "sass": "^1.70.0", "sass-loader": "^14.1.0", "style-loader": "^3.3.4", "ts-jest": "^29.1.2", "ts-loader": "^9.5.1", "typescript": "^5.3.3", "webpack": "^5.90.1", "webpack-cli": "^5.1.4" }, "overrides": { "react-virtual": { "react": "$react" } } }jest.config.js
account-bar\index.tsx
account-bar\__tests__\account-bar.tsx
Code of Conduct