Skip to content

Commit

Permalink
fix: remove hardcoded config test values
Browse files Browse the repository at this point in the history
  • Loading branch information
Rmannn committed Jan 27, 2021
1 parent 74814aa commit 7eefb3b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 11.x, 12.x, 13.x]
node-version: [10.x, 12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v1
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestjs-node-config",
"version": "0.0.4",
"version": "0.0.5",
"description": "The nestjs node-config package",
"author": "Alex Hermann <[email protected]>",
"repository": "https://github.com/Pop-Code/nestjs-node-config",
Expand All @@ -9,10 +9,10 @@
"scripts": {
"build": "rm -Rf ./dist && tsc",
"doc": "rm -Rf ./docs && typedoc ./src && touch ./docs/.nojekyll",
"test": "NODE_CONFIG_DIR=src/test/config jest",
"test:watch": "NODE_CONFIG_DIR=src/test/config jest --watch",
"test:cov": "NODE_CONFIG_DIR=src/test/config jest --coverage",
"test:debug": "NODE_CONFIG_DIR=src/test/config node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest",
"lint": "eslint ./src/**/*.ts",
"format": "prettier \"**/*.ts\" --ignore-path ./.prettierignore --write && git status"
},
Expand Down Expand Up @@ -57,13 +57,13 @@
"json",
"ts"
],
"rootDir": "src",
"rootDir": ".",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.{js,jsx,ts}",
"src/**/*.{js,jsx,ts}",
"!index.ts",
"!**/test/**"
],
Expand Down
5 changes: 0 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import * as config from 'config';

import { CONFIG_TOKEN } from './constants';

process.env.NODE_CONFIG = JSON.stringify({
test: { foo: "bar", bar: "foo" }
});


export const configProvider = {
provide: CONFIG_TOKEN,
useValue: config
Expand Down
2 changes: 1 addition & 1 deletion src/test/module.spec.ts → test/module.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';

import { getConfigToken, IConfig, NodeConfigModule } from '../module';
import { getConfigToken, IConfig, NodeConfigModule } from '../src/module';

let app: INestApplication;

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"outDir": "dist",
"lib": ["es7", "DOM"]
},
"include": ["src/**/*"]
"include": ["src/**/*", "test"]
}

0 comments on commit 7eefb3b

Please sign in to comment.