Question with Angular 16(Test) & GraphQL & Karma #2044
Unanswered
PankajPatro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
Don't know if this question is already asked. We are using this package and are in the process of migrating our application to Angular 16. Post migrating our angular tests stopped working, but I was able to partially fix by adding these rules in the web.config.
,
// This has been included because of graphql
{
test: /.mjs$/,
resolve: {
fullySpecified: false,
},
include: /node_modules/,
type: "javascript/auto"
},
// This has been included because of graphql
{
test: /.js$/,
resolve: {
fullySpecified: false,
},
include: /node_modules/,
type: "javascript/auto"
}
While that fixed the issues with GraphQLError and Query but the tests are still not running with this issue
./node_modules/rfc4648/lib/index.mjs:6:25-38 - Error: export 'default' (imported as 'cjs') was not found in './index.js' (possible exports: __esModule, base16, base32, base32hex, base64, base64url, codec)
Any directions on how to fix this issue would be greatly appreciated.
Here is the test section of my angular.json
"test": {
"builder": "@angular-builders/custom-webpack:karma",
"options": {
"customWebpackConfig": {
"path": "./webpack.test.config.js"
},
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"stylePreprocessorOptions": {
"includePaths": [
"src/sass",
"node_modules"
]
},
"tsConfig": "src/tsconfig.spec.json",
"styles": [
"src/sass/main.scss"
],
"assets": [
"src/assets"
]
}
The respective packages are
"@angular/core": "^16.1.2",
"@apollo/client": "^3.7.16",
"apollo-angular": "^5.0.0",
"graphql": "^16.7.1",
"typescript": "4.9.3",
Node 18.15.0
Beta Was this translation helpful? Give feedback.
All reactions