Skip to content

Commit 4012f9b

Browse files
committed
Fix tests
1 parent 9f4ec4f commit 4012f9b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ node_js:
33
- '0.11'
44
- '5.0'
55
- '6.0'
6-
after_success: bash <(curl -s https://codecov.io/bash)
6+
after_script: bash <(curl -s https://codecov.io/bash)
77
deploy:
88
provider: npm
99

test/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ test('travisDiff()', function (t) {
3232
var stepThree = 'Lorem.\n' + stepOne + '\nLorem.';
3333
var other = 'Lorem ipsum.';
3434
var initial;
35-
var final;
35+
36+
delete process.env.TRAVIS_COMMIT_RANGE;
3637

3738
t.plan(7);
3839

@@ -62,6 +63,15 @@ test('travisDiff()', function (t) {
6263
fs.writeFile(file.path, file.contents, next);
6364
});
6465
})
66+
.use(function () {
67+
return execa('git', ['config', '--global', 'user.email'])
68+
.catch(function () {
69+
return execa('git', ['config', '--global', 'user.email', '[email protected]'])
70+
.then(function () {
71+
return execa('git', ['config', '--global', 'user.name', 'Ex Ample']);
72+
});
73+
});
74+
})
6575
.use(function () {
6676
return execa('git', ['add', 'example.txt']);
6777
})
@@ -143,9 +153,7 @@ test('travisDiff()', function (t) {
143153
.use(function (result, next) {
144154
var file = vfile({path: 'example.txt', contents: stepTwo});
145155

146-
final = result.stdout;
147-
148-
process.env.TRAVIS_COMMIT_RANGE = [initial, final].join('...');
156+
process.env.TRAVIS_COMMIT_RANGE = [initial, result.stdout].join('...');
149157

150158
processor.process(file, function (err) {
151159
t.deepEqual(

0 commit comments

Comments
 (0)