Skip to content

Commit e461130

Browse files
committed
test: co-located test files with the source files
1 parent 01878de commit e461130

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:md": "remark --quiet . --frail",
1111
"lint:travis": "travis-lint .travis.yml",
1212
"lint:peer": "npm ls >/dev/null",
13-
"tests:unit:no-coverage": "mocha --recursive test/unit",
13+
"tests:unit:no-coverage": "mocha 'src/**/*-test.js'",
1414
"coverage": "nyc run-s tests:unit:no-coverage",
1515
"coverage:report": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
1616
"test:unit": "run-s coverage",

test/unit/data-fetcher-test.js renamed to src/data-fetcher-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sinon from 'sinon';
22
import {assert} from 'chai';
33
import any from '@travi/any';
44
import redial from 'redial';
5-
import fetchData from '../../src/data-fetcher';
5+
import fetchData from './data-fetcher';
66

77
suite('data fetcher', () => {
88
let sandbox;

test/unit/default-render-factory-test.js renamed to src/default-render-factory-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {RouterContext} from 'react-router';
44
import sinon from 'sinon';
55
import any from '@travi/any';
66
import {assert} from 'chai';
7-
import defaultRenderFactory from '../../src/default-render-factory';
7+
import defaultRenderFactory from './default-render-factory';
88

99
suite('default-render factory', () => {
1010
let sandbox;

test/unit/route-matcher-test.js renamed to src/route-matcher-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as reactRouter from 'react-router';
33
import sinon from 'sinon';
44
import {assert} from 'chai';
55
import any from '@travi/any';
6-
import matchRoute from '../../src/route-matcher';
6+
import matchRoute from './route-matcher';
77

88
suite('route matcher', () => {
99
let sandbox;

test/unit/route-test.js renamed to src/route-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sinon from 'sinon';
22
import {assert} from 'chai';
33
import any from '@travi/any';
4-
import {plugin} from '../../src/route';
5-
import * as routerWrapper from '../../src/router-wrapper';
4+
import {plugin} from './route';
5+
import * as routerWrapper from './router-wrapper';
66

77
suite('route', () => {
88
let sandbox;
@@ -16,7 +16,7 @@ suite('route', () => {
1616
teardown(() => sandbox.restore());
1717

1818
test('that the plugin is defined', () => {
19-
assert.deepEqual(plugin.pkg, require('../../package.json'));
19+
assert.deepEqual(plugin.pkg, require('../package.json'));
2020
});
2121

2222
test('that the request for html is handled', async () => {

test/unit/router-wrapper-test.js renamed to src/router-wrapper-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import sinon from 'sinon';
33
import {assert} from 'chai';
44
import any from '@travi/any';
55
import Boom from '@hapi/boom';
6-
import renderThroughReactRouter from '../../src/router-wrapper';
7-
import * as defaultRenderFactory from '../../src/default-render-factory';
8-
import * as routeMatcher from '../../src/route-matcher';
9-
import * as dataFetcher from '../../src/data-fetcher';
6+
import renderThroughReactRouter from './router-wrapper';
7+
import * as defaultRenderFactory from './default-render-factory';
8+
import * as routeMatcher from './route-matcher';
9+
import * as dataFetcher from './data-fetcher';
1010

1111
suite('router-wrapper', () => {
1212
let sandbox;

0 commit comments

Comments
 (0)