Skip to content

Upgrade date-fns@2 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"chalk": "^2.4.1",
"cli-cursor": "^2.1.0",
"date-fns": "^1.27.2",
"date-fns": "^2.0.1",
"figures": "^2.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ exports.testOutput = (t, expected) => {
t.plan(t._test.planCount || expected.length);
let i = 0;

const unhook = hookStd(actual => {
const promise = hookStd(actual => {
t.is(stripAnsi(actual), `${expected[i++]}`);

if (i === expected.length) {
unhook();
promise.unhook();
}
});
};
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {serial as test} from 'ava';
import Listr from 'listr';
import format from 'date-fns/format';
import renderer from '..';
import {testOutput} from './fixtures/utils';
import renderer from '..';

const date = format(new Date(), 'DD/MM/YYYY');
const date = format(new Date(), 'dd/MM/yyyy');

test('task succeeds', async t => {
const list = new Listr([
Expand All @@ -14,7 +14,7 @@ test('task succeeds', async t => {
}
], {
renderer,
dateFormat: 'DD/MM/YYYY'
dateFormat: 'dd/MM/yyyy'
});

testOutput(t, [
Expand All @@ -35,7 +35,7 @@ test('task fails', async t => {
}
], {
renderer,
dateFormat: 'DD/MM/YYYY'
dateFormat: 'dd/MM/yyyy'
});

testOutput(t, [
Expand Down