1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-16 10:20:05 +00:00

test: improved tests

This commit is contained in:
Yury Shkoda
2021-08-03 08:26:42 +03:00
parent b3c4425215
commit 8b1e79497f
7 changed files with 13 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
module.exports = { module.exports = {
preset: 'ts-jest', preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'node', testEnvironment: 'node',
coverageThreshold: { coverageThreshold: {
global: { global: {
@@ -9,5 +9,6 @@ module.exports = {
statements: -10 statements: -10
} }
}, },
collectCoverageFrom: ['src/**/{!(index),}.ts'] collectCoverageFrom: ['src/**/{!(index),}.ts'],
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/build/']
} }

View File

@@ -4,7 +4,7 @@
"description": "SASjs server", "description": "SASjs server",
"main": "./src/server.ts", "main": "./src/server.ts",
"scripts": { "scripts": {
"start": "nodemon ./src/index.ts", "start": "nodemon ./src/server.ts",
"build": "rimraf build && tsc", "build": "rimraf build && tsc",
"semantic-release": "semantic-release -d", "semantic-release": "semantic-release -d",
"prepare": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true", "prepare": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true",
@@ -38,5 +38,8 @@
"ts-jest": "^27.0.3", "ts-jest": "^27.0.3",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
"typescript": "^4.3.2" "typescript": "^4.3.2"
},
"configuration": {
"sasPath": "C:\\Program Files\\SASHome\\SASFoundation\\9.4\\sas.exe"
} }
} }

View File

View File

@@ -1,6 +1,6 @@
import app from './app' import app from './app'
const port = 5000 const port = 5000
app.listen(port, () => { const listener = app.listen(port, () => {
console.log(`⚡️[server]: Server is running at http://localhost:${port}`) console.log(`⚡️[server]: Server is running at http://localhost:${port}`)
}) })

View File

@@ -6,3 +6,5 @@ export const getTmpFolderPath = () =>
export const getTmpFilesFolderPath = () => export const getTmpFilesFolderPath = () =>
path.join(getTmpFolderPath(), 'files') path.join(getTmpFolderPath(), 'files')
export const getTmpLogFolderPath = () => path.join(getTmpFolderPath(), 'log')

1
src/utils/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from './file'

View File

@@ -5,6 +5,7 @@
"rootDir": "./", "rootDir": "./",
"outDir": "./build", "outDir": "./build",
"esModuleInterop": true, "esModuleInterop": true,
"strict": true "strict": true,
"resolveJsonModule": true
} }
} }