Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 15, 2018
1 parent a44e57e commit 61197f3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: false
language: node_js
node_js:
- '8'
- '6'
- '4'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Run mobile and desktop performance tests for your deployed site using [Google Pa
## Install

```
$ npm install --save psi
$ npm install psi
```


Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "psi",
"version": "3.0.0",
"description": "PageSpeed Insights with reporting",
"license": "Apache-2.0",
"repository": "addyosmani/psi",
"author": {
"name": "Addy Osmani",
"email": "[email protected]",
Expand All @@ -11,8 +13,6 @@
"engines": {
"node": ">=4"
},
"repository": "addyosmani/psi",
"license": "Apache-2.0",
"scripts": {
"test": "xo && mocha"
},
Expand All @@ -32,20 +32,21 @@
"size"
],
"dependencies": {
"chalk": "^1.1.1",
"chalk": "^2.3.0",
"download": "^4.4.1",
"googleapis": "^16.1.0",
"googleapis": "^24.0.0",
"humanize-url": "^1.0.1",
"lodash": "^4.5.1",
"meow": "^3.5.0",
"pify": "^2.3.0",
"prepend-http": "^1.0.3",
"meow": "^4.0.0",
"pify": "^3.0.0",
"prepend-http": "^2.0.0",
"pretty-bytes": "^4.0.2",
"sort-on": "^1.2.2",
"sort-on": "^2.0.0",
"strip-ansi": "^4.0.0",
"update-notifier": "^2.0.0"
},
"devDependencies": {
"mocha": "^3.2.0",
"mocha": "^4.1.0",
"xo": "^0.18.0"
},
"xo": {
Expand Down
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict';
const assert = require('assert');
const chalk = require('chalk');
const stripAnsi = require('strip-ansi');
const output = require('../lib/output');
const psi = require('..');
const response = require('./fixtures/response');
Expand All @@ -23,19 +23,19 @@ describe('Formatting', () => {

it('should correctly format PageSpeed Insights response', function () {
return output({strategy: 'desktop'}, response).then(() => {
assert(/Speed: +88/.test(chalk.stripColor(this.formattedOutput)));
assert(/Speed: +88/.test(stripAnsi(this.formattedOutput)));
});
});

it('should format PageSpeed Insights response as TAP output', function () {
return output({strategy: 'desktop', format: 'tap'}, response).then(() => {
assert(/ok 1 - psi/.test(chalk.stripColor(this.formattedOutput)));
assert(/ok 1 - psi/.test(stripAnsi(this.formattedOutput)));
});
});

it('should format PageSpeed Insights response as JSON output', function () {
return output({strategy: 'desktop', format: 'json'}, response).then(() => {
assert(/"Speed": 88/.test(chalk.stripColor(this.formattedOutput)));
assert(/"Speed": 88/.test(stripAnsi(this.formattedOutput)));
});
});

Expand Down
5 changes: 3 additions & 2 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
/* eslint-env mocha */
const assert = require('assert');
const chalk = require('chalk');
const stripAnsi = require('strip-ansi');
const utils = require('../lib/utils');

describe('Report utils', () => {
it('should create a divider', () => {
const expected = '\n--------------------------------------------------------\n';
assert.equal(chalk.stripColor(utils.divider), expected);
assert.equal(stripAnsi(utils.divider), expected);
});

it('should create buffer space', () => {
Expand All @@ -20,7 +21,7 @@ describe('Report utils', () => {
it('should create label', () => {
const expected = 'Enable GZIP compression | ';
const msg = 'EnableGzipCompression';
assert.equal(chalk.stripColor(utils.labelize(msg)), expected);
assert.equal(stripAnsi(utils.labelize(msg)), expected);
});

it('should select red for scores 20 or less', () => {
Expand Down

0 comments on commit 61197f3

Please sign in to comment.