Move tests

This commit is contained in:
Jake Howard 2017-02-19 21:59:54 +00:00
parent 53df4c6e3f
commit 69f55aadc7
4 changed files with 5 additions and 7 deletions

View file

@ -11,7 +11,7 @@
"postinstall": "typings install", "postinstall": "typings install",
"build": "tsc", "build": "tsc",
"test": "npm run build && npm run mocha && nsp check", "test": "npm run build && npm run mocha && nsp check",
"mocha": "mocha --compilers ts:ts-node/register --require scripts/test-helper.js src/__tests__/**.test.ts", "mocha": "mocha --compilers ts:ts-node/register --require scripts/test-helper.js tests/**.test.ts",
"lint": "tslint src/**/*.ts" "lint": "tslint src/**/*.ts"
}, },
"engines": { "engines": {

View file

@ -1,9 +1,8 @@
import createServer from '../server'; import createServer from '../src/server';
import { Options } from '../types'; import { Options } from '../src/types';
import fetch from 'node-fetch'; import fetch from 'node-fetch';
export function runServer(opts: Object, url : string, callback: Function) { export function runServer(opts: Object, url : string, callback: Function) {
const app = createServer(opts as Options); const app = createServer(opts as Options);
const server = app.listen(1234, function () { const server = app.listen(1234, function () {

View file

@ -39,7 +39,7 @@ describe('Server', function () {
}); });
describe('index route', function () { describe('index route', function () {
const body = fs.readFileSync(__dirname + '/../../site/index.html').toString(); const body = fs.readFileSync(__dirname + '/../site/index.html').toString();
['', '/', '/index.html'].forEach(function (path : string) { ['', '/', '/index.html'].forEach(function (path : string) {
it('should render ' + path, function (done) { it('should render ' + path, function (done) {

View file

@ -1,7 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"rootDir": "src",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"noImplicitAny": true, "noImplicitAny": true,
"experimentalDecorators": true, "experimentalDecorators": true,
@ -18,7 +17,7 @@
"dist", "dist",
"node_modules", "node_modules",
"scripts/", "scripts/",
"src/__tests__" "tests/"
], ],
"typeRoots": [ "typeRoots": [
"node_modules", "node_modules",