-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eda412c
commit 8610723
Showing
35 changed files
with
95 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
/* eslint-disable import/no-unresolved */ | ||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */ | ||
import test from 'ava'; | ||
|
||
test(t => t.pass()); | ||
test(t => { | ||
t.pass(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
module.exports = function (babel) { | ||
var t = babel.types; | ||
'use strict'; | ||
|
||
function isRequire(path) { | ||
return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); | ||
} | ||
|
||
module.exports = babel => { | ||
const t = babel.types; | ||
|
||
return { | ||
visitor: { | ||
CallExpression: function (path) { | ||
CallExpression: path => { | ||
// skip require calls | ||
var firstArg = path.get('arguments')[0]; | ||
|
||
if (!isRequire(path) && firstArg && firstArg.isStringLiteral() && /foo/i.test(firstArg.node.value)) { | ||
firstArg.replaceWith(t.stringLiteral(firstArg.node.value.replace('foo', 'bar').replace('FOO', 'BAR'))); | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
function isRequire(path) { | ||
return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
module.exports = function (babel) { | ||
var t = babel.types; | ||
'use strict'; | ||
|
||
function isRequire(path) { | ||
return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); | ||
} | ||
|
||
module.exports = babel => { | ||
const t = babel.types; | ||
|
||
return { | ||
visitor: { | ||
CallExpression: function (path) { | ||
CallExpression: path => { | ||
// skip require calls | ||
var firstArg = path.get('arguments')[0]; | ||
const firstArg = path.get('arguments')[0]; | ||
|
||
if (!isRequire(path) && firstArg && firstArg.isStringLiteral() && !/repeated test/.test(firstArg.node.value)) { | ||
firstArg.replaceWith(t.stringLiteral(firstArg.node.value.toUpperCase())); | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
function isRequire(path) { | ||
return path.isCallExpression() && path.get('callee').isIdentifier() && (path.get('callee').node.name === 'require'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import test from '../../../' | ||
import test from '../../../'; | ||
|
||
test(t => t.true(2 + 2 === 4)); | ||
test(t => { | ||
t.true(2 + 2 === 4); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import test from '../../'; | ||
|
||
test.beforeEach(t => t.context = 'bar'); | ||
test.beforeEach(t => { | ||
t.context = 'bar'; | ||
}); | ||
|
||
test.cb('callback mode', ({context: foo, ... t}) => { | ||
test.cb('callback mode', ({context: foo, ...t}) => { | ||
t.is(foo, 'bar'); | ||
t.end(); | ||
}); | ||
|
||
test.cb('callback mode #2', ({context: foo, end, ... t}) => { | ||
test.cb('callback mode #2', ({context: foo, end, ...t}) => { | ||
t.is(foo, 'bar'); | ||
end(); | ||
}); | ||
|
||
test('sync', ({context: foo, ... t}) => { | ||
test('sync', ({context: foo, ...t}) => { | ||
t.is(foo, 'bar'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import test from '../../'; | ||
|
||
test.only(t => { | ||
t.pass(); | ||
t.pass(); | ||
}); | ||
|
||
test(t => { | ||
t.fail(); | ||
t.fail(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import test from '../../'; | ||
|
||
test.only(t => { | ||
t.pass(); | ||
t.pass(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
'use strict'; | ||
process.exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
'use strict'; | ||
process.exit(3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ test.cb(t => { | |
Promise.resolve().then(() => { | ||
t.throws(throwSync()); | ||
}); | ||
|
||
setTimeout(t.end, 20); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
'use strict'; | ||
global.foo = 'bar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,4 @@ test.cb('slow', t => { | |
setTimeout(t.end, 5000); | ||
}); | ||
|
||
test('fast', t => { | ||
|
||
}); | ||
test('fast', () => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
'use strict'; | ||
module.exports = 'baz'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
'use strict'; | ||
module.exports = 'bar'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import test from '../../../../' | ||
import test from '../../../../'; | ||
|
||
const opts = JSON.parse(process.argv[2]); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
'use strict'; | ||
|
||
module.exports = 'foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
module.exports = "bar"; | ||
'use strict'; | ||
module.exports = 'bar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
'use strict'; | ||
|
||
module.exports = 'foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import test from '../../'; | ||
|
||
var tests = []; | ||
const tests = []; | ||
|
||
test.cb('first', t => { | ||
setTimeout(() => { | ||
|
Oops, something went wrong.