Skip to content

Commit

Permalink
minor doc and style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 23, 2016
1 parent d72723b commit 0e6db13
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 24 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
1 change: 0 additions & 1 deletion .lgtm

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ node_js:
- '0.12'
- '0.10'
before_install:
- 'npm i -g npm@latest'
- 'npm install -g npm@latest'
after_success:
- '[ -z "$COVERALLS_REPO_TOKEN" ] && tap --coverage-report=text-lcov | ./node_modules/.bin/coveralls'
8 changes: 4 additions & 4 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ var chalk = require('chalk');
var objectAssign = require('object-assign');
var commondir = require('commondir');
var resolveCwd = require('resolve-cwd');
var uniqueTempDir = require('unique-temp-dir');
var findCacheDir = require('find-cache-dir');
var AvaError = require('./lib/ava-error');
var fork = require('./lib/fork');
var formatter = require('./lib/enhance-assert').formatter();
var CachingPrecompiler = require('./lib/caching-precompiler');
var uniqueTempDir = require('unique-temp-dir');
var findCacheDir = require('find-cache-dir');

function Api(files, options) {
if (!(this instanceof Api)) {
Expand Down Expand Up @@ -96,6 +96,7 @@ Api.prototype._handleTest = function (test) {
if (isError) {
if (test.error.powerAssertContext) {
var message = formatter(test.error.powerAssertContext);

if (test.error.originalMessage) {
message = test.error.originalMessage + ' ' + message;
}
Expand Down Expand Up @@ -153,11 +154,10 @@ Api.prototype.run = function () {
var cacheEnabled = self.options.cacheEnabled !== false;
var cacheDir = (cacheEnabled && findCacheDir({name: 'ava', files: files})) ||
uniqueTempDir();

self.options.cacheDir = cacheDir;
self.precompiler = new CachingPrecompiler(cacheDir);

self.fileCount = files.length;

self.base = path.relative('.', commondir('.', files)) + path.sep;

var tests = files.map(self._runFile);
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- set AVA_APPVEYOR=true
- npm -g install npm@latest || (timeout 30 && npm -g install npm@latest)
- npm install -g npm@latest || (timeout 30 && npm install -g npm@latest)
- set PATH=%APPDATA%\npm;%PATH%
- npm install || (timeout 30 && npm install)
matrix:
Expand Down
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var resolveCwd = require('resolve-cwd');
var localCLI = resolveCwd('ava/cli');

if (localCLI && localCLI !== __filename) {
debug('Using local install of AVA.');
debug('Using local install of AVA');
require(localCLI);
return;
}
Expand Down
14 changes: 7 additions & 7 deletions docs/recipes/code-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ First, we need a Babel configuration. The following is just an example. You will

There are two important things to note from the example above.

1. We ignore test files because AVA already handles transpiling tests for you.
1. We ignore test files because AVA already handles transpiling tests for you.

2. We specify `inline` source maps for development. This is important for properly generating coverage. Using the `env` section of the Babel configuration allows us to disable source maps for production builds.
2. We specify `inline` source maps for development. This is important for properly generating coverage. Using the `env` section of the Babel configuration allows us to disable source maps for production builds.


### Create a build script
Expand All @@ -77,15 +77,15 @@ Since it is unlikely you want `inline` source maps in your production code. You

```json
{
"scripts": {
"build": "BABEL_ENV=production babel --out-dir=dist index.js"
}
"scripts": {
"build": "BABEL_ENV=production babel --out-dir=dist index.js"
}
}
```

> WARNING: `BABEL_ENV=production` does not work on Windows, you must use the `set` keyword (`set BABEL_ENV=production`). For cross platform builds, check out [`cross-env`].
Note that the build script really has very little to do with AVA, and is just a demonstration of how to use Babel's `env` configuration to manipulate your config so it is compatible with AVA.
Note that the build script really has very little to do with AVA, and is just a demonstration of how to use Babel's `env` configuration to manipulate your config so it's compatible with AVA.

### Use the Babel require hook

Expand Down Expand Up @@ -167,7 +167,7 @@ Then add the following to your `.travis.yml`:

```yaml
after_success:
- './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls'
- './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls'
```

Your coverage report will then appear on coveralls shortly after Travis completes.
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/endpoint-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function makeApp() {
}
```

Next, just inject your server instance into supertest. The only gotcha is to use a promise or async/await syntax instead of supertest's `end` method:
Next, just inject your server instance into supertest. The only gotcha is to use a promise or async/await syntax instead of the supertest `end` method:

```js
test('signup:Success', async t => {
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"url": "sindresorhus.com"
},
"maintainers": [
{
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
{
"name": "Kevin Mårtensson",
"email": "[email protected]",
Expand Down

0 comments on commit 0e6db13

Please sign in to comment.