Skip to content

Commit 7bd5827

Browse files
authored
Merge pull request arduino#16 from nmzaheer/main
Support for Part separator symbols added
2 parents eac6d39 + 42382c4 commit 7bd5827

7 files changed

+314
-30
lines changed

Diff for: .github/workflows/test-typescript-npm.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test TypeScript
2+
3+
env:
4+
# See: https://github.com/actions/setup-node/#readme
5+
NODE_VERSION: 10.x
6+
7+
on:
8+
push:
9+
paths:
10+
- ".github/workflows/test-typescript-npm.ya?ml"
11+
- ".github/.?codecov.ya?ml"
12+
- "dev/.?codecov.ya?ml"
13+
- ".?codecov.ya?ml"
14+
- "jest.config.js"
15+
- "package.json"
16+
- "package-lock.json"
17+
- "tsconfig.json"
18+
- "**.js"
19+
- "**.jsx"
20+
- "**.ts"
21+
- "**.tsx"
22+
pull_request:
23+
paths:
24+
- ".github/workflows/test-typescript-npm.ya?ml"
25+
- "jest.config.js"
26+
- "package.json"
27+
- "package-lock.json"
28+
- "tsconfig.json"
29+
- "**.js"
30+
- "**.jsx"
31+
- "**.ts"
32+
- "**.tsx"
33+
schedule:
34+
# Run periodically to catch breakage caused by external changes.
35+
- cron: "0 13 * * WED"
36+
workflow_dispatch:
37+
repository_dispatch:
38+
39+
jobs:
40+
test:
41+
runs-on: ${{ matrix.operating-system }}
42+
43+
strategy:
44+
fail-fast: false
45+
46+
matrix:
47+
operating-system:
48+
- macos-latest
49+
- ubuntu-latest
50+
# The version of node-gyp used by this project (7.1.2) requires an older version of Visual Studio that is not
51+
# available in the latest Windows GitHub Actions runner.
52+
- windows-2019
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v3
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: ${{ env.NODE_VERSION }}
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Run tests
67+
run: npm run-script test
68+
69+
- name: Send unit test coverage to Codecov
70+
if: runner.os == 'Linux'
71+
uses: codecov/codecov-action@v3
72+
with:
73+
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-serial-plotter-webapp' }}

Diff for: README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Serial Plotter WebApp
22

3+
[![Test TypeScript status](https://github.com/arduino/arduino-serial-plotter-webapp/actions/workflows/test-typescript-npm.yml/badge.svg)](https://github.com/arduino/arduino-serial-plotter-webapp/actions/workflows/test-typescript-npm.yml)
4+
35
This is a SPA that receives data points over WebSocket and prints graphs. The purpose is to provide a visual and live representation of data printed to the Serial Port.
46

57
The application is designed to be as agnostic as possible regarding how and where it runs. For this reason, it accepts different settings when it's launched in order to configure the look&feel and the connection parameters.
@@ -162,6 +164,7 @@ These are sent to the middleware to be stored and propagated to other clients.
162164
## Development
163165
164166
- `npm i` to install dependencies
167+
- `npm test` to run automated tests
165168
- `npm start` to run the application in development mode @ [http://localhost:3000](http://localhost:3000)
166169
167170
## Deployment

Diff for: jest.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/en/configuration.html
4+
*/
5+
6+
module.exports = {
7+
collectCoverage: true,
8+
coverageDirectory: "coverage",
9+
coverageReporters: ["lcov"],
10+
preset: "ts-jest",
11+
testEnvironment: "node",
12+
};

Diff for: package-lock.json

+62-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"start": "react-scripts start",
88
"build": "react-scripts build",
9-
"test": "react-scripts test",
9+
"test": "jest",
1010
"eject": "react-scripts eject"
1111
},
1212
"files": [
@@ -49,6 +49,7 @@
4949
"chartjs-plugin-streaming": "^2.0.0",
5050
"eslint-config-prettier": "^8.3.0",
5151
"eslint-plugin-prettier": "^4.0.0",
52+
"jest": "^26.6.0",
5253
"luxon": "^2.1.0",
5354
"node-sass": "^6.0.1",
5455
"prettier": "^2.4.1",
@@ -60,6 +61,7 @@
6061
"react-scripts": "4.0.3",
6162
"react-select": "^5.1.0",
6263
"react-switch": "^6.0.0",
64+
"ts-jest": "^26.5.6",
6365
"typescript": "^4.4.3",
6466
"web-vitals": "^1.1.2",
6567
"worker-loader": "^3.0.8"

0 commit comments

Comments
 (0)