-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/master/mjs' of https://github.com/giltayar/teen…
…ytest into giltayar-feature/master/mjs
- Loading branch information
Showing
21 changed files
with
1,051 additions
and
611 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "4" | ||
- "6" | ||
- "10" | ||
- "12" | ||
- "13" | ||
- "14" |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/node_modules/* | ||
!/node_modules/.bin | ||
!/node_modules/teenytest | ||
/node_modules/.bin/* | ||
!/node_modules/.bin/teenytest | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var _ = require('lodash') | ||
|
||
function Dog (name) { | ||
this.name = name | ||
} | ||
|
||
Dog.prototype.bark = function (times) { | ||
return _.map(_.range(times), function (i) { | ||
return 'Woof #' + i | ||
}) | ||
} | ||
|
||
Dog.prototype.tag = function (side) { | ||
if (side === 'front') { | ||
return 'Hi, I am ' + this.name | ||
} else { | ||
return 'And here is my address' | ||
} | ||
} | ||
|
||
module.exports = Dog |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "example", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "Just an example project", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "teenytest" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(async function () { | ||
try { | ||
await import('lodash') | ||
process.exit(0) | ||
} catch (err) { | ||
process.exit(1) | ||
} | ||
})() |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
beforeAll: function () { 'I run absolutely first' }, | ||
beforeEach: function () { 'I run before each test' }, | ||
afterEach: function () { 'I run right after each test' }, | ||
afterAll: function () { 'I run absolutely last' }, | ||
options: { | ||
asyncTimeout: 100, | ||
asyncInterval: 1 | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var assert = require('core-assert') | ||
var Dog = require('../../lib/dog') | ||
|
||
module.exports = { | ||
beforeEach: function () { | ||
this.subject = new Dog('Sam') | ||
}, | ||
bark: { | ||
once: function () { | ||
assert.deepEqual(this.subject.bark(1), ['Woof #0']) | ||
}, | ||
twice: function () { | ||
assert.deepEqual(this.subject.bark(2), ['Woof #0', 'Woof #1']) | ||
} | ||
}, | ||
tag: { | ||
frontSaysName: function () { | ||
assert.equal(this.subject.tag('front'), 'Hi, I am Sam') | ||
}, | ||
backSaysAddress: function () { | ||
assert.equal(this.subject.tag('back'), 'And here is my address') | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import assert from 'core-assert' | ||
import Dog from '../../lib/dog.js' | ||
|
||
export function beforeEach () { | ||
this.subject = new Dog('Sam') | ||
}; | ||
|
||
export const bark = { | ||
once: function () { | ||
assert.deepEqual(this.subject.bark(1), ['Woof #0']) | ||
}, | ||
twice: function () { | ||
assert.deepEqual(this.subject.bark(2), ['Woof #0', 'Woof #1']) | ||
} | ||
} | ||
|
||
export const tag = { | ||
frontSaysName: function () { | ||
assert.equal(this.subject.tag('front'), 'Hi, I am Sam') | ||
}, | ||
backSaysAddress: function () { | ||
assert.equal(this.subject.tag('back'), 'And here is my address') | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var assert = require('core-assert') | ||
|
||
module.exports = function blueIsRed () { | ||
assert.equal('blue', 'red') | ||
} |
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,9 +1,10 @@ | ||
var modules = require('./modules') | ||
var helper = require('./helper') | ||
var loadModules = require('./modules') | ||
var loadHelper = require('./helper') | ||
|
||
module.exports = function (config) { | ||
return { | ||
helper: helper(config.helperPath, config.cwd), | ||
modules: modules(config.criteria, config.cwd) | ||
} | ||
module.exports = async function (config) { | ||
const [helper, modules] = await Promise.all([ | ||
loadHelper(config.helperPath, config.cwd), | ||
loadModules(config.criteria, config.cwd) | ||
]) | ||
return { helper, modules } | ||
} |
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
Oops, something went wrong.