Skip to content

Instantly share code, notes, and snippets.

View DaveMBush's full-sized avatar

Dave Bush DaveMBush

  • Cheshire, CT
View GitHub Profile
@DaveMBush
DaveMBush / FirstTest.spec.js
Last active August 6, 2016 17:43
WebDriverIO-Samples
"use strict";
describe('First test',()=>{
beforeEach(()=>{
browser.url('https://www.google.com');
});
it('should display "Google" in the title',()=>{
expect(browser.getTitle()).toBe('Google');
});
});
function add(a,b){
return a + b;
}
var newFoo = add.bind(this,3,4);
console.log(newFoo());
@DaveMBush
DaveMBush / BasicObjectWithPrivates.js
Last active June 18, 2016 11:20
Accessing ‘private’ JavaScript variables from Unit Tests
function MyClass(){
function privateMember(){
}
function publicMember(){
privateMember.apply(this);
}
this.publicMember = publicMember;
}
for(var i = 0;i < 10;i++){
$.ajax({
url: /* url goes here */,
success: function (moduleHtml) {
console.log(i);
}
});
}