File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change
1
+ # Use an official Node runtime as a parent image
2
+ FROM node:14
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /usr/src/app
6
+
7
+ # Copy the current directory contents into the container at /usr/src/app
8
+ COPY . .
9
+
10
+ # Install any needed packages specified in package.json
11
+ RUN npm install
12
+
13
+ # Install Chrome for Selenium tests
14
+ RUN apt-get update && apt-get install -y \
15
+ gnupg \
16
+ wget \
17
+ && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
18
+ && apt install ./google-chrome-stable_current_amd64.deb -y
19
+
20
+ # Make port available to the world outside this container
21
+ EXPOSE 8080
22
+
23
+ # Define environment variable
24
+ ENV NODE_ENV production
25
+
26
+ # Run npm test when the container launches
27
+ CMD ["npm", "test"]
Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"build" : " npm run clean && tsc" ,
8
+ "docker-build" : " docker build -t yourdockerusername/mocha-typescript ." ,
8
9
"clean" : " rimraf ./build ./package.zip" ,
9
10
"test" : " _mocha ./build/test/restrictedAccessTest.js --timeout=999999 --exit" ,
10
- "regression" : " _mocha ./build/test/regression.js --timeout=999999 --exit"
11
-
11
+ "regression" : " _mocha ./build/test/regression.js --timeout=999999 --exit" ,
12
+ "invalidLoginTest" : " _mocha ./build/test/invalidLoginTest.js --timeout=999999 --exit" ,
13
+ "restrictedAccessTest" : " _mocha ./build/test/restrictedAccessTest.js --timeout=999999 --exit" ,
14
+ "shoppingExp" : " _mocha ./build/test/shoppingExp.js --timeout=999999 --exit" ,
15
+ "validLoginTest" : " _mocha ./build/test/validLoginTest.js --timeout=999999 --exit"
12
16
},
13
17
"keywords" : [],
14
18
"author" : " Apichai Tochonnabod" ,
You can’t perform that action at this time.
0 commit comments