Skip to content

Commit 879f427

Browse files
committed
loadConfigFile is asynchronous
1 parent f24cfa2 commit 879f427

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

setup/nodejs.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const runner = new Jasmine();
225225
### Load configuration from a file or from an object
226226

227227
```javascript
228-
runner.loadConfigFile('spec/support/jasmine.json');
228+
await runner.loadConfigFile('spec/support/jasmine.json');
229229

230230
runner.loadConfig({
231231
spec_dir: 'spec',
@@ -305,10 +305,23 @@ runner.execute(['fooSpec.js'], 'a spec name');
305305
### A simple example using the library
306306

307307
```javascript
308+
// CommonJS
308309
const Jasmine = require('jasmine');
309310
const runner = new Jasmine();
310311

311-
runner.loadConfigFile('spec/support/jasmine.json');
312+
runner.loadConfigFile('spec/support/jasmine.json')
313+
.then(function() {
314+
runner.configureDefaultReporter({
315+
showColors: false
316+
});
317+
runner.execute();
318+
});
319+
320+
// or ESM:
321+
import Jasmine from 'jasmine';
322+
const runner = new Jasmine();
323+
324+
await runner.loadConfigFile('spec/support/jasmine.json');
312325
runner.configureDefaultReporter({
313326
showColors: false
314327
});

0 commit comments

Comments
 (0)