Skip to content

Commit fbb68b2

Browse files
committed
fix(server): add option for compatibility with jest
1 parent a138cea commit fbb68b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

template/server/server.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import boot from 'loopback-boot';
33

44
const app = loopback();
55

6+
const options = {
7+
appRootDir: __dirname,
8+
// File Extensions for jest (strongloop/loopback#3204)
9+
scriptExtensions: ['.js', '.json', '.node', '.ejs'],
10+
}
11+
612
let httpServer;
713

814
app.start = function() {
@@ -25,7 +31,7 @@ app.close = function() {
2531

2632
// Bootstrap the application, configure models, datasources and middleware.
2733
// Sub-apps like REST API are mounted via boot scripts.
28-
boot(app, __dirname, (err) => {
34+
boot(app, options, (err) => {
2935
if (err) throw err;
3036

3137
// start the server if `$ node server.js`

0 commit comments

Comments
 (0)