Skip to content

Commit ac60f9a

Browse files
committed
test: update test file structure and scripts
1 parent 6db21a9 commit ac60f9a

File tree

13 files changed

+1435
-138
lines changed

13 files changed

+1435
-138
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ In the root folder:
1010
1. Run `npm run link` to point the demo app to use the local directive's source.
1111
2. Run `ng serve` to launch the demo app.
1212

13+
### Test
14+
1. Build: `npm run build -- -c production`
15+
2. Test with Docker: `bin/test.sh`
16+
17+

bin/test.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Use this to test the angular project with cypress.
3+
# Execute from the project's root folder.
4+
5+
get_lib_version() {
6+
echo $(cd dist/ionic-header-parallax && npm pkg get version)
7+
}
8+
9+
run_test() {
10+
version=$1
11+
docker run \
12+
--rm \
13+
-v "$PWD:/project" \
14+
-v "$PWD/dist/ionic-header-parallax:/dist" \
15+
raschidjfr/ionic-blank:ionic8-angular19-cypress14 \
16+
bash -c "\
17+
mkdir cypress \
18+
&& cp -r /project/cypress/* ./cypress \
19+
&& cp /project/cypress.config.ts . \
20+
&& cp -r /project/src/app/home/* ./src/app/home \
21+
&& npm i /dist/ionic-header-parallax-$version.tgz \
22+
&& ng serve --host 0.0.0.0 --port 4200 \
23+
& (wait-on http://0.0.0.0:4200 && cypress run --headless) \
24+
|| { echo 'Angular server failed to start'; exit 1; }"
25+
}
26+
27+
lib_version=$(get_lib_version)
28+
run_test $lib_version
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)