Skip to content

Commit 9805670

Browse files
authored
Merge pull request #5 from Rareloop/allow-reconnect
Update testing documentation
2 parents 87f3e50 + d36dbe5 commit 9805670

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

projects/ionic-typeorm/docs/testing.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Ionic Typeorm Testing Configuration
22

3+
## Karma Testing
4+
35
An issue with `sql.js:1.5.0` means it doesn't work nicely with karma. In order to work around this an older copy of `sql.js` is included instead for unit testing.
46

57
For unit tests: `karma.conf.js`
@@ -28,3 +30,46 @@ and `tsconfig.spec.json`
2830
}
2931
}
3032
```
33+
34+
## Cypress Testing
35+
36+
If you are using Cypress for e2e testing, you can enable coverage in the webpack config.
37+
This relies on `istanbul-instrumenter-loader` as a `dev` dependency.
38+
39+
In `angular.json` this will look like
40+
41+
``` json
42+
{
43+
"projects": {
44+
"app": {
45+
"architect": {
46+
"build": {
47+
"configurations": {
48+
"ci": {
49+
"customWebpackConfig": {
50+
"path": "node_modules/@rareloop/ionic-typeorm/config/webpack.coverage.asm.js"
51+
}
52+
},
53+
}
54+
},
55+
"e2e": {
56+
"builder": "@briebug/cypress-schematic:cypress",
57+
"options": {
58+
"devServerTarget": "app:serve:ci",
59+
"watch": true,
60+
"headless": false
61+
}
62+
},
63+
"e2e-ci": {
64+
"builder": "@briebug/cypress-schematic:cypress",
65+
"options": {
66+
"browser": "chrome",
67+
"devServerTarget": "app:serve:ci",
68+
"headless": true,
69+
"watch": false
70+
}
71+
}
72+
}
73+
}
74+
}
75+
```

0 commit comments

Comments
 (0)