Descripción | Assert o TDD | BDD |
---|---|---|
Define una suite de tests | suite | describe o context |
Se ejecuta una vez antes de todos los tests de una suite | suiteSetup | before |
Se ejecuta una vez después de todos los tests de una suite | suiteTeardown | after |
Se ejecuta antes de cada test de una suite | setup | beforeEach |
Se ejecuta después de cada test de una suite | teardown | afterEach |
Test | test | it |
Assert * | assert | expect o should |
This file contains hidden or 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
test('Example using stub', () => { | |
const stub = sinon.stub(sut, 'doSomething'); | |
sut.doSomething(); | |
assert.isTrue(stub.called); | |
}); |
This file contains hidden or 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
test('Example using spy', () => { | |
const spy = sinon.spy(sut, 'doSomething'); | |
sut.doSomething(); | |
assert.isTrue(spy.called); | |
}); |
This file contains hidden or 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
{ | |
"name": "demo-project", | |
"version": "0.0.0", | |
"scripts": { | |
"build": "sampleframework build", | |
"start": "sampleframework serve", | |
"test": "sampleframework test" | |
}, | |
"devDependencies": { | |
"sampleframework-cli": "~3.5.0" |
This file contains hidden or 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
language: node_js | |
node_js: "8" | |
cache: npm | |
script: npm run build -- -prod | |
deploy: | |
provider: pages |
This file contains hidden or 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
{ | |
"name": "@myscope/mypackage", | |
"main": "mypackage.js", | |
"version": "0.0.0", | |
"dependencies": { | |
"@polymer/lit-element": "^0.6.5" | |
}, | |
"devDependencies": { | |
"@webcomponents/webcomponentsjs": "^2.2.0", | |
"polymer-cli": "^1.9.4", |
This file contains hidden or 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
{ | |
"lint": { | |
"rules": [ | |
"polymer-3" | |
] | |
}, | |
"entrypoint": "demo/index.html", | |
"extraDependencies": [ | |
"your-component.js" | |
], |
This file contains hidden or 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
language: node_js | |
node_js: "8" | |
addons: | |
chrome: stable | |
install: | |
- npm install | |
- npm install -g codecov |
Esto es un gist de prueba.
module.exports.onCreateNode = ({ node, actions }) => {
const { createNodeField } = actions
if (node.internal.type === 'MarkdownRemark') {
const slug = path.basename(node.fileAbsolutePath, '.md')
createNodeField({
This file contains hidden or 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
'use strict'; | |
const browserSync = require('browser-sync').create(); | |
const portfinder = require('portfinder'); | |
const {spawn} = require('child_process'); | |
const COMPONENT_PATH = process.env.npm_package_name; | |
const browserSyncConfig = { | |
open: false, | |
notify: false, |