Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
docs: convert readme example to commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Jun 16, 2017
1 parent 5e181f3 commit 4555afd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@
WYSIWYM—the above **human-readable** test output corresponds to what is programmed:

```ts
import {browser, it, test} from 'cybernaut';
const {browser, it, test} = require('cybernaut');

test('This is an example test', async t => {
await t.perform(browser.loadPage('http://example.com/'), {retries: 0});
Expand Down
5 changes: 4 additions & 1 deletion scripts/src/update-readme.ts
Expand Up @@ -6,7 +6,10 @@ const readme = readFileSync('README.md', options);
const index1 = readme.indexOf('```ts');
const index2 = readme.indexOf('```', index1 + 5);

const example = readFileSync('examples/src/readme.e2e.ts', options).trim();
const example = readFileSync('examples/src/readme.e2e.ts', options)
.trim()
.replace('import {', 'const {')
.replace("} from 'cybernaut'", "} = require('cybernaut')");

const updatedReadme = `${readme.slice(
0,
Expand Down

0 comments on commit 4555afd

Please sign in to comment.