-
Add [grunt-build-control][] to your app:
npm install --save grunt-build-control
-
Append its Grunt task:
buildcontrol: {
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
/* | |
'plugin:prettier/recommended' does the following: | |
extends: ['prettier'], | |
plugins: ['prettier'], | |
rules: { | |
'prettier/prettier': 'error' | |
} | |
*/ | |
module.exports = { |
On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this
object, and we've seen some awesome benefits from doing such.
Up until recently, a typical unit test for us looked something like this:
describe('views.Card', function() {
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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '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
/* | |
Template literals for-loop example | |
Using `Array(5).join(0).split(0)`, we create an empty array | |
with 5 items which we can iterate through using `.map()` | |
*/ | |
var element = document.createElement('div') | |
element.innerHTML = ` | |
<h1>This element is looping</h1> | |
${Array(5).join(0).split(0).map((item, i) => ` |
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
/** | |
* Inspired by AngularJS' implementation of "click dblclick mousedown..." | |
* | |
* This ties in the Hammer events to attributes like: | |
* | |
* hm-tap="add_something()" | |
* hm-swipe="remove_something()" | |
* | |
* and also has support for Hammer options with: | |
* |