You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/01-configuration-file.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,20 @@ module.exports = (config) => {
53
53
}
54
54
```
55
55
56
+
Alternatively, you can use an `async` function instead (since v6.3).
57
+
58
+
```javascript
59
+
// karma.conf.js
60
+
module.exports=async (config) => {
61
+
constkarmaConfig=awaitgetKarmaConfig("dev");
62
+
63
+
config.set({
64
+
...karmaConfig
65
+
});
66
+
};
67
+
```
68
+
69
+
56
70
### Customized TypeScript Configuration
57
71
Under the hood Karma uses ts-node to transpile TypeScript to JavaScript. If the resolved `tsconfig.json` has `module` configured as `ES` formats. You might get errors like `SyntaxError: Unexpected token`. This is due that in Node `ES` module formats are not supported. To overcome this issue you need to configure ts-node to use `commonjs` module format.
0 commit comments