Skip to content

Commit

Permalink
chore: confirm working with e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
swashata committed Jul 27, 2021
1 parent 12cc73f commit 98f6ac4
Show file tree
Hide file tree
Showing 3 changed files with 1,757 additions and 1,526 deletions.
19 changes: 10 additions & 9 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Once it is complete, we would check for build (production) files.

```bash
yarn build
yarn archive
yarn test
```

Expand All @@ -55,15 +56,15 @@ We use travis CI and the following sequence of commands take care of e2e testing

```yml
script:
- yarn
- yarn serve &>/dev/null &
- yarn wait-for-test-server
- yarn start &>/dev/null &
- yarn wait-for-wpackio-server
- yarn cypress:runapp
- yarn build
- yarn cypress:runprod
- yarn test
- yarn
- yarn serve &>/dev/null &
- yarn wait-for-test-server
- yarn start &>/dev/null &
- yarn wait-for-wpackio-server
- yarn cypress:runapp
- yarn build
- yarn cypress:runprod
- yarn test
```
We use the public version of cypress dashboard, which can be found [here](https://dashboard.cypress.io/#/projects/r3p1vm/runs).
Expand Down
17 changes: 8 additions & 9 deletions e2e/__tests__/fileExists.intg.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/extensions */
/* eslint-disable spaced-comment, jest/valid-expect */
/// <reference types="jest" />

Expand All @@ -17,8 +18,8 @@ function fileExists(filepath) {
describe('after build', () => {
test('all javascript app got compiled', () => {
const jsApps = [
...jsManifest.wpackioEp.main.js,
...jsManifest.wpackioEp.main.css,
...jsManifest.wpackioEp.main.assets.js,
...jsManifest.wpackioEp.main.assets.css,
];
jsApps.forEach(file => {
expect(
Expand All @@ -28,8 +29,8 @@ describe('after build', () => {
});
test('all typescript app got compiled', () => {
const tsApps = [
...tsManifest.wpackioEp.main.js,
...tsManifest.wpackioEp.main.css,
...tsManifest.wpackioEp.main.assets.js,
...tsManifest.wpackioEp.main.assets.css,
];
tsApps.forEach(file => {
expect(
Expand All @@ -44,16 +45,14 @@ describe('after pack', () => {
const zipFiles = [
'index.html',
'README.md',
...jsManifest.wpackioEp.main.js.map(item => `dist/${item}`),
...tsManifest.wpackioEp.main.js.map(item => `dist/${item}`),
...jsManifest.wpackioEp.main.assets.js.map(item => `dist/${item}`),
...tsManifest.wpackioEp.main.assets.js.map(item => `dist/${item}`),
'dist/app/manifest.json',
'dist/tsapp/manifest.json',
];
zipFiles.forEach(file => {
expect(
fileExists(
path.resolve(__dirname, '../package/e2e-plug/', file)
)
fileExists(path.resolve(__dirname, '../package/e2e-plug/', file))
).toBeTruthy();
});
});
Expand Down
Loading

0 comments on commit 98f6ac4

Please sign in to comment.