Skip to content

Commit

Permalink
Various minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 9, 2017
1 parent a1e08ab commit 2ed9485
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
[*.yml]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto
*.js text eol=lf
*.ai binary
*.psd binary
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ before_install:
before_script:
- 'npm prune'
after_success:
- '[ -z "$COVERALLS_REPO_TOKEN" ] && tap --coverage-report=text-lcov | ./node_modules/.bin/coveralls'
- './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov'
4 changes: 2 additions & 2 deletions bench/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const childProcess = require('child_process');
const path = require('path');
const fs = require('fs');
const arrify = require('arrify');
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');
const branch = require('git-branch').sync(path.join(__dirname, '..'));

const cliPath = require.resolve('../cli');
Expand Down Expand Up @@ -124,7 +124,7 @@ Promise.each(combined, definition => {
});
});
}).then(() => {
mkdirp.sync(path.join(__dirname, '.results'));
makeDir.sync(path.join(__dirname, '.results'));
results['.time'] = Date.now();

fs.writeFileSync(
Expand Down
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const debug = require('debug')('ava');

// Prefer the local installation of AVA.
const resolveCwd = require('resolve-cwd');

const localCLI = resolveCwd('ava/cli');

// Use `path.relative()` to detect local AVA installation,
Expand Down
4 changes: 2 additions & 2 deletions lib/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const chalk = require('chalk');
const figures = require('figures');
const configManager = require('hullabaloo-config-manager');
const md5Hex = require('md5-hex');
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');
const colors = require('./colors');

function validate(conf) {
Expand Down Expand Up @@ -90,7 +90,7 @@ function build(projectDir, cacheDir, userOptions, powerAssert) {
const seed = md5Hex([process.versions.node, projectDir]);

// Ensure cacheDir exists
mkdirp.sync(cacheDir);
makeDir.sync(cacheDir);

// The file names predict where valid options may be cached, and thus should
// include the seed.
Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"arrify": "^1.0.0",
"auto-bind": "^1.1.0",
"ava-init": "^0.2.0",
"babel-code-frame": "^6.16.0",
"babel-core": "^6.17.0",
"bluebird": "^3.0.0",
"caching-transform": "^1.0.0",
Expand Down Expand Up @@ -149,11 +148,11 @@
"lodash.flatten": "^4.2.0",
"lodash.isequal": "^4.5.0",
"loud-rejection": "^1.2.0",
"make-dir": "^1.0.0",
"matcher": "^0.1.1",
"md5-hex": "^2.0.0",
"meow": "^3.7.0",
"mkdirp": "^0.5.1",
"ms": "^0.7.1",
"ms": "^1.0.0",
"multimatch": "^2.1.0",
"observable-to-promise": "^0.5.0",
"option-chain": "^0.1.0",
Expand All @@ -174,12 +173,12 @@
"update-notifier": "^2.1.0"
},
"devDependencies": {
"babel-preset-react": "^6.5.0",
"cli-table2": "^0.2.0",
"coveralls": "^2.11.4",
"delay": "^1.3.0",
"codecov": "^2.1.0",
"del": "^2.2.2",
"delay": "^2.0.0",
"execa": "^0.6.0",
"flow-bin": "^0.42.0",
"flow-bin": "^0.45.0",
"get-stream": "^3.0.0",
"git-branch": "^0.3.0",
"has-ansi": "^2.0.0",
Expand All @@ -188,7 +187,6 @@
"lolex": "^1.4.0",
"nyc": "^10.0.0",
"proxyquire": "^1.7.4",
"rimraf": "^2.5.0",
"signal-exit": "^3.0.0",
"sinon": "^2.0.0",
"source-map-fixtures": "^2.1.0",
Expand All @@ -202,7 +200,6 @@
"typings": "types/generated.d.ts",
"xo": {
"rules": {
"import/newline-after-import": "off",
"no-use-extend-native/no-use-extend-native": "off"
}
},
Expand Down
7 changes: 4 additions & 3 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
const path = require('path');
const fs = require('fs');
const figures = require('figures');
const rimraf = require('rimraf');
const del = require('del');
const test = require('tap').test;
const Api = require('../api');

const testCapitalizerPlugin = require.resolve('./fixture/babel-plugin-test-capitalizer');

const ROOT_DIR = path.join(__dirname, '..');
Expand Down Expand Up @@ -658,7 +659,7 @@ function generateTests(prefix, apiCreator) {
});

test(`${prefix} caching is enabled by default`, t => {
rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules'));
del.sync(path.join(__dirname, 'fixture/caching/node_modules'));

const api = apiCreator({
resolveTestsFrom: path.join(__dirname, 'fixture/caching')
Expand Down Expand Up @@ -687,7 +688,7 @@ function generateTests(prefix, apiCreator) {
});

test(`${prefix} caching can be disabled`, t => {
rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules'));
del.sync(path.join(__dirname, 'fixture/caching/node_modules'));

const api = apiCreator({
resolveTestsFrom: path.join(__dirname, 'fixture/caching'),
Expand Down
4 changes: 2 additions & 2 deletions test/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const fs = require('fs');
const path = require('path');
const test = require('tap').test;
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');
const uniqueTempDir = require('unique-temp-dir');
const configManager = require('hullabaloo-config-manager');

Expand Down Expand Up @@ -154,7 +154,7 @@ test('updates cached verifier if dependency hashes change', t => {
const cacheDir = path.join(projectDir, 'cache');
const depFile = path.join(projectDir, 'plugin.js');

mkdirp.sync(cacheDir);
makeDir.sync(cacheDir);
fs.writeFileSync(depFile, 'foo');

const userOptions = {
Expand Down
1 change: 1 addition & 0 deletions test/beautify-stack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const proxyquire = require('proxyquire').noPreserveCache();
const test = require('tap').test;

const beautifyStack = proxyquire('../lib/beautify-stack', {
debug() {
return {
Expand Down
4 changes: 2 additions & 2 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const childProcess = require('child_process');
const test = require('tap').test;
const getStream = require('get-stream');
const figures = require('figures');
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');
const touch = require('touch');
const proxyquire = require('proxyquire');
const sinon = require('sinon');
Expand Down Expand Up @@ -451,7 +451,7 @@ test('workers ensure test files load the same version of ava', t => {

// Copy the index.js so the testFile imports it. It should then load the correct AVA install.
const targetInstall = path.join(target, 'node_modules/ava');
mkdirp.sync(targetInstall);
makeDir.sync(targetInstall);
fs.writeFileSync(
path.join(targetInstall, 'index.js'),
fs.readFileSync(path.join(__dirname, '../index.js'))
Expand Down

0 comments on commit 2ed9485

Please sign in to comment.