Skip to content

Commit

Permalink
Tests: Refactor testing that loaded correct files [refactor]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 21, 2020
1 parent ed2b6d0 commit 8708c24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions test/fixtures/main/child.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

const Route = require('@overlook/route');

module.exports = new Route({
_path: '/child'
});
module.exports = new Route({__filename});
4 changes: 1 addition & 3 deletions test/fixtures/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ const Route = require('@overlook/route'),

const LoadRoute = Route.extend(loadPlugin);

module.exports = new LoadRoute({
_path: '/'
});
module.exports = new LoadRoute({__filename});
4 changes: 2 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('loads from folder', () => {
});

it('is loaded from correct file', () => {
expect(root._path).toBe('/');
expect(root.__filename).toBe(pathJoin(fixturePath, 'index.js'));
});

it('has name "root"', () => {
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('loads from folder', () => {
});

it('is loaded from correct file', () => {
expect(route._path).toBe('/child');
expect(route.__filename).toBe(pathJoin(fixturePath, 'child.js'));
});

it('has name according to file name', () => {
Expand Down

0 comments on commit 8708c24

Please sign in to comment.