chore: Setup ava and sinon test libraries
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const backend = require('..');
|
||||
|
||||
describe('backend', () => {
|
||||
it('needs tests');
|
||||
});
|
@@ -6,7 +6,7 @@
|
||||
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/app.ts",
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"test": "ava",
|
||||
"db:create": "ts-node ./bin/database/create.ts",
|
||||
"db:drop": "ts-node ./bin/database/drop.ts",
|
||||
"db:migration:create": "knex migrate:make",
|
||||
@@ -56,7 +56,20 @@
|
||||
"@types/morgan": "^1.9.3",
|
||||
"@types/node": "^16.10.2",
|
||||
"@types/pg": "^8.6.1",
|
||||
"ava": "^3.15.0",
|
||||
"nodemon": "^2.0.13",
|
||||
"sinon": "^11.1.2",
|
||||
"ts-node": "^10.2.1"
|
||||
},
|
||||
"ava": {
|
||||
"files": [
|
||||
"test/**/*"
|
||||
],
|
||||
"extensions": [
|
||||
"ts"
|
||||
],
|
||||
"require": [
|
||||
"ts-node/register"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
7
packages/backend/test/sample.ts
Normal file
7
packages/backend/test/sample.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import test from 'ava';
|
||||
|
||||
const fn = () => 'foo';
|
||||
|
||||
test('fn() returns foo', t => {
|
||||
t.is(fn(), 'foo');
|
||||
});
|
Reference in New Issue
Block a user