Skip to content

Commit

Permalink
Unit test CI (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Jul 19, 2024
1 parent 16dbbed commit c1dbce1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- name: Run end-to-end tests
run: xvfb-run npm run test:e2e
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- Run ts checks, linting, and unit tests
run: npm run test:ci
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"main": "./out/extension.js",
"scripts": {
"clean": "rm -rf out",
"test": "npm run ts:build && npm run ts:check && npm run test:lint && npm run test:unit",
"test": "npm run test:ci",
"test:ci": "npm run ts:build && npm run ts:check && npm run test:lint && npm run test:unit",
"test:e2e": "npm run ts:build && cd e2e && wdio run ./wdio.conf.ts",
"test:lint": "eslint . --ext ts",
"test:unit": "vitest",
Expand Down
8 changes: 8 additions & 0 deletions src/util/ExtendedMap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import { describe, expect, it } from 'vitest';
import { ExtendedMap } from './ExtendedMap';

describe('ExtendedMap Test Suite', () => {
it('CI test', () => {
throw new Error('This is testing CI');
});

it('CI test 2', () => {
expect(4).toBe(5);
});

it('getOrThrow', () => {
const map = new ExtendedMap<string, number>();

Expand Down

0 comments on commit c1dbce1

Please sign in to comment.