start new:
tmux
start new with session name:
tmux new -s myname
title | slug | createdAt | language | preview |
---|---|---|---|---|
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom |
unit-testing-angular-js-app-with-node |
2015-07-05T18:04:33Z |
en |
Majority of search result about unit testing Angular.js apps is about how to do it by using test frameworks that run the tests in a real browser. Even though it's great to be able to test your code in multiple platforms, in my opinion it creates a lot of boilerplate code and makes it hard to run the tests in, for instance a CI-server. |
Lean unit tests with minimal setup
export class HelperJsInCss{ | |
constructor(element, customProperty, loop, args){ | |
this.element = element | |
this.customProperty = customProperty | |
this.lastValue = undefined | |
this.loop = loop | |
this.args = args | |
if (loop){ | |
window.requestAnimationFrame(this.checkElements.bind(this)) |
const fetch = require('node-fetch'); | |
async function run() { | |
let username = "YOUR USERNAME HERE"; | |
let password = "YOUR APP PASSWORD"; | |
let authBasic = new Buffer(username + ':' + password).toString('base64'); | |
let session = await (await fetch('https://jmap.fastmail.com/.well-known/jmap', { | |
headers: { | |
"Authorization": "Basic " + authBasic | |
} | |
})).json(); |