Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
es2015 example - add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Åström committed Nov 9, 2017
1 parent c496eb6 commit 6e8356e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 3 deletions.
48 changes: 48 additions & 0 deletions examples/es2015/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This is a sample for es2015 and requirejs

## From the project root run

```shell
./src/cli.js chrome -c examples/es2015/aw.config.js
```

`aw.config.js`

```javascript
module.exports = {
url: 'http://localhost:9676/examples/es2015/index.html',
glob: ['examples/es2015/*.spec.js'],
'transform.include': ['examples/es2015/*.js'],
};

```

![](./es2015.gif)

## Generating coverage

To be able to generate coverage we need to serve the files with a http server and instrument the source files

```shell
./src/cli.js chrome -c examples/es2015/aw.config.js --coverage
```

![](./es2015-coverage.gif)

## Debugging

Using [vscode](https://code.visualstudio.com/)

Install [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)

Add configuration to launch Chrome and the `cdp` runner

![](./es2015-debug.gif)

If your favourite editor doesn't support chrome debugging you can pass the `chrome.devtools=true` option to run Chrome with `--auto-open-devtools-for-tabs`

```shell
./src/cli.js chrome -c examples/es2015/aw.config.js --chrome.devtools=true
```

![](./es2015-debug-devtools.gif)
4 changes: 1 addition & 3 deletions examples/es2015/a.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import chai from 'chai';
import { expect } from 'chai';
import getA from './a';

const { expect } = chai;

describe('es2015 - a', () => {
it('should return "a"', () => {
expect(getA()).to.equal('a');
Expand Down
5 changes: 5 additions & 0 deletions examples/es2015/aw.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
url: 'http://localhost:9676/examples/es2015/index.html',
glob: ['examples/es2015/*.spec.js'],
'transform.include': ['examples/es2015/*.js'],
};
Binary file added examples/es2015/es2015-coverage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/es2015/es2015-debug-devtools.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/es2015/es2015-debug.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/es2015/es2015.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e8356e

Please sign in to comment.