Skip to content

Commit

Permalink
Fixed "Want more control?" example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
sgravrock committed May 18, 2024
1 parent a3342e1 commit 4e9b990
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,24 @@ second parameter to`startServer`.
## Want more control?

```javascript
const path = require('path');
const jasmineBrowser = require('jasmine-browser-runner');
// ESM
import path from 'path';
import jasmineBrowser from 'jasmine-browser-runner';
import config from './spec/support/jasmine-browser.mjs';

const config = await import('spec/support/jasmine-browser.mjs');
config.projectBaseDir = path.resolve('some/path');

jasmineBrowser.startServer(config, { port: 4321 });


// CommonJS
const path = require('path');
const jasmineBrowser = require('jasmine-browser-runner');

import('./spec/support/jasmine-browser.mjs')
.then(function({default: config}) {
config.projectBaseDir = path.resolve('some/path');
jasmineBrowser.startServer(config, { port: 4321 });
});
```

## Supported environments
Expand Down

0 comments on commit 4e9b990

Please sign in to comment.