diff --git a/.github/workflows/add_wf.yml b/.github/workflows/add_wf.yml new file mode 100644 index 0000000..049e428 --- /dev/null +++ b/.github/workflows/add_wf.yml @@ -0,0 +1,29 @@ +name: Run unit test + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + tests: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.14 + - uses: actions/cache@v3 + with: + path: ./nodejs/node_modules + key: nodejs-${{ hashFiles('./nodejs/package-lock.json') }} + - name: Install packages + run: npm install + working-directory: ./nodejs + - name: Run test + run: npm test run + working-directory: ./nodejs diff --git a/nodejs/add.test.js b/nodejs/add.test.js index 191486f..c3cee14 100644 --- a/nodejs/add.test.js +++ b/nodejs/add.test.js @@ -1,5 +1,5 @@ -import { add } from './add'; +import { add } from "./add"; -test('add test', () => { - expect(add(10, 15)).toBe(25) -}) \ No newline at end of file +test("add test", () => { + expect(add(10, 15)).toBe(25); +});