Permalink
Browse files

minor doc and style tweaks

  • Loading branch information...
1 parent d72723b commit 0e6db13a918f0116927299271d91fff590328cb9 @sindresorhus sindresorhus committed Jan 23, 2016
Showing with 15 additions and 24 deletions.
  1. +0 −3 .editorconfig
  2. +0 −1 .lgtm
  3. +1 −1 .travis.yml
  4. +4 −4 api.js
  5. +1 −1 appveyor.yml
  6. +1 −1 cli.js
  7. +7 −7 docs/recipes/code-coverage.md
  8. +1 −1 docs/recipes/endpoint-testing.md
  9. +0 −5 package.json
View
@@ -10,6 +10,3 @@ insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
View
@@ -1 +0,0 @@
-approvals = 2
View
@@ -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'
View
@@ -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)) {
@@ -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;
}
@@ -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);
View
@@ -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:
View
@@ -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;
}
@@ -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
@@ -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
@@ -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.
@@ -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 => {
View
@@ -12,11 +12,6 @@
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"

0 comments on commit 0e6db13

Please sign in to comment.