Skip to content

Commit 4803ab9

Browse files
committed
Run npm install in the react app before starting
1 parent 9747850 commit 4803ab9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

run-tests.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Build Docker images
4+
docker-compose build
5+
6+
# Start services and stop all when tests are complete
7+
docker-compose up --abort-on-container-exit
8+
9+
# Capture the exit code of the tests service
10+
EXIT_CODE=$(docker-compose ps -q tests | xargs docker inspect -f '{{ .State.ExitCode }}')
11+
12+
# Shutdown services
13+
docker-compose down
14+
15+
# Exit with the tests service's exit code
16+
exit $EXIT_CODE

todomvc-acceptance-tests/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@
108108
<artifactId>process-exec-maven-plugin</artifactId>
109109
<version>0.9</version>
110110
<executions>
111+
<execution>
112+
<id>npm-install</id>
113+
<phase>generate-resources</phase>
114+
<goals>
115+
<goal>start</goal>
116+
</goals>
117+
<configuration>
118+
<name>npm-install</name>
119+
<workingDir>${project.basedir}/../react-todomvc</workingDir>
120+
<arguments>
121+
<argument>npm</argument>
122+
<argument>install</argument>
123+
</arguments>
124+
</configuration>
125+
</execution>
111126
<execution>
112127
<id>start-app</id>
113128
<phase>pre-integration-test</phase>

0 commit comments

Comments
 (0)