Skip to content

Instantly share code, notes, and snippets.

@JaKXz
Last active June 28, 2016 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JaKXz/e91baeead7f4ff2df6825abf33327479 to your computer and use it in GitHub Desktop.
Save JaKXz/e91baeead7f4ff2df6825abf33327479 to your computer and use it in GitHub Desktop.
nyc@7.0.0-alpha3 lcov report broken
{
"name": "nyc-ava-test",
"version": "1.0.0",
"description": "",
"main": "say.js",
"scripts": {
"test": "nyc -r lcov ava"
},
"author": "",
"license": "ISC",
"babel": {
"presets": [
"es2015"
]
},
"ava": {
"require": [
"babel-register"
]
},
"nyc": {
"require": [
"babel-register"
]
},
"devDependencies": {
"ava": "^0.15.1",
"babel": "^6.5.2",
"babel-cli": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"nyc": "^7.0.0-alpha.3"
}
}
module.exports = function say({
greeting = 'Hello',
noun = 'world'
} = {}) {
return greeting + ' ' + noun;
}
import test from 'ava';
import say from './say.js';
test('should default to hello world', t => {
t.is(say(), 'Hello world');
});
test('should say a custom greeting to hello world', t => {
t.is(say({
greeting: 'Hi',
noun: 'Phil'
}), 'Hi Phil');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment