Skip to content

Commit 7082a74

Browse files
authored
Merge pull request #73 from 201-created/migrate-test-helpers-js
migrate test-helpers.js to import APP from src/main
2 parents 8f2407e + ff7d64c commit 7082a74

4 files changed

Lines changed: 51 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,14 @@ loadInitializers(App, config.modulePrefix+'/src/init');
9595
loadInitializers(App, config.modulePrefix);
9696
```
9797

98-
Finally, in `tests/test-helper.js`, load the app from `../src/main`
98+
### Running Tests
9999

100-
```js
101-
import Application from '../src/main';
102-
```
100+
* `npm run test`
101+
102+
To debug tests:
103+
104+
* All tests: `mocha --debug-brk --inspect test/**/*-test.js`
105+
* A single test: `mocha --debug-brk --inspect test/**/*-test.js --grep test-helpers`
103106

104107
### Important Notes
105108

lib/engines/classic/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ module.exports = {
112112
options.type = testType;
113113
options.base = 'tests';
114114
return new ClassicFileInfo(options);
115+
} else {
116+
return new MiscFileInfo(options);
115117
}
116118
} else if (sourceRoot === 'config') {
117119
return new ConfigFileInfo(options);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
app: {
3+
'app.js': '// app',
4+
'resolver.js': '// resolver',
5+
adapters: {
6+
'.eslint.js': '{}'
7+
}
8+
},
9+
config: {
10+
'environment.js': '"ENV"'
11+
},
12+
tests: {
13+
'.eslintrc.js': 'module.exports = {};',
14+
'.eslint.js': '{}',
15+
'test-helper.js': 'import App from "../app";',
16+
helpers: {
17+
'resolver.js': 'import Resolver from "../../resolver";'
18+
}
19+
}
20+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
app: {
3+
adapters: {
4+
'.eslint.js': '{}'
5+
}
6+
},
7+
src: {
8+
'main.js': '// app',
9+
'resolver.js': '// resolver'
10+
},
11+
config: {
12+
'environment.js': '"ENV"'
13+
},
14+
tests: {
15+
'.eslintrc.js': 'module.exports = {};',
16+
'.eslint.js': '{}',
17+
'test-helper.js': 'import App from "../src/main";',
18+
'helpers': {
19+
'resolver.js': 'import Resolver from "../../src/resolver";'
20+
}
21+
}
22+
};

0 commit comments

Comments
 (0)