Skip to content

Commit

Permalink
Update unit test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigabyte5671 committed Dec 24, 2022
1 parent 9fd7a7d commit 4c37f5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/node-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "npx ts-node tests/index.ts"
"test": "node dist/tests/index.js",
"build": "tsc"
},
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions tests/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const { execSync } = require('child_process');
import { execSync } from 'child_process';

// Utility functions:

console.log('Testing hexToString...');
execSync('npx ts-node tests/hexToString.test.ts', {stdio: 'inherit'});
execSync('node dist/tests/hexToString.test.js', {stdio: 'inherit'});

console.log('Testing stringToHex...');
execSync('npx ts-node tests/stringToHex.test.ts', {stdio: 'inherit'});
execSync('node dist/tests/stringToHex.test.js', {stdio: 'inherit'});

console.log('Testing textToHex...');
execSync('npx ts-node tests/textToHex.test.ts', {stdio: 'inherit'});
execSync('node dist/tests/textToHex.test.js', {stdio: 'inherit'});

console.log('Testing invertEndianness...');
execSync('npx ts-node tests/invertEndianness.test.ts', {stdio: 'inherit'});
execSync('node dist/tests/invertEndianness.test.js', {stdio: 'inherit'});

0 comments on commit 4c37f5f

Please sign in to comment.