From c1305c96b6ba60c42d9fb7ca286cb5caa71f42b7 Mon Sep 17 00:00:00 2001 From: sgnl Date: Mon, 9 Nov 2015 11:19:50 -1000 Subject: [PATCH 1/5] update test order --- test/specs/basics.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/specs/basics.spec.js b/test/specs/basics.spec.js index 69a5e7a..669342f 100644 --- a/test/specs/basics.spec.js +++ b/test/specs/basics.spec.js @@ -37,14 +37,6 @@ describe( 'Main', function() { }); }); - describe('canDrive', function() { - it ('should be true if `person` is atleast 16 years old', function() { - expect(canDrive).to.exist; - (typeof canDrive).should.equal('boolean'); - canDrive.should.equal(person.age >= 16); - }); - }); - describe( '#greet', function() { it('should be a function', function() { @@ -61,6 +53,14 @@ describe( 'Main', function() { }); }); + describe('canDrive', function() { + it ('should be true if `person` is atleast 16 years old', function() { + expect(canDrive).to.exist; + (typeof canDrive).should.equal('boolean'); + canDrive.should.equal(person.age >= 16); + }); + }); + describe('dataTypes', function() { it('should be an array', function() { expect(dataTypes).to.exist; From 5fca04c73763f788f1b108fd7ea724c023a2d9a6 Mon Sep 17 00:00:00 2001 From: sgnl Date: Mon, 9 Nov 2015 11:20:32 -1000 Subject: [PATCH 2/5] fix tests for `canDrive` --- test/specs/basics.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/basics.spec.js b/test/specs/basics.spec.js index 669342f..fea95ba 100644 --- a/test/specs/basics.spec.js +++ b/test/specs/basics.spec.js @@ -56,8 +56,8 @@ describe( 'Main', function() { describe('canDrive', function() { it ('should be true if `person` is atleast 16 years old', function() { expect(canDrive).to.exist; - (typeof canDrive).should.equal('boolean'); - canDrive.should.equal(person.age >= 16); + (typeof canDrive).should.equal('function'); + canDrive().should.equal(person.age >= 16); }); }); From 9e2f4227af4a7d8a18a4c565e3a823a9ca8edc24 Mon Sep 17 00:00:00 2001 From: sgnl Date: Mon, 9 Nov 2015 11:23:50 -1000 Subject: [PATCH 3/5] update npm script - reduce test scripts down to a single script --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 4beba5f..df7bfbe 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "test": "test" }, "scripts": { - "test": "mocha", - "karma": "./node_modules/.bin/karma start --single-run --no-auto-watch --browsers PhantomJS; exit 0" + "test": "./node_modules/.bin/karma start --single-run --no-auto-watch --browsers PhantomJS" }, "repository": { "type": "git", From f70619446b662034b52b8314ac68db73ca3bdc27 Mon Sep 17 00:00:00 2001 From: sgnl Date: Mon, 9 Nov 2015 11:37:02 -1000 Subject: [PATCH 4/5] remove redundant test setup code and comments --- test/specs/basics.spec.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test/specs/basics.spec.js b/test/specs/basics.spec.js index fea95ba..2d939f9 100644 --- a/test/specs/basics.spec.js +++ b/test/specs/basics.spec.js @@ -1,8 +1,3 @@ -var expect = chai.expect; -var should = chai.should(); - -// load basics.js into new VM - describe( 'Main', function() { var sandbox; @@ -42,7 +37,6 @@ describe( 'Main', function() { it('should be a function', function() { (typeof greet).should.equal('function'); }); - it( 'should print a greeting', function() { var name = 'Dev League'; greet( name ); @@ -85,12 +79,6 @@ describe( 'Main', function() { }); describe( 'dog object literal', function() { - // var spot = new Dog('Spot'); - // it('should be a function', function() { - // (typeof Dog).should.equal('object'); - // expect(Dog).to.exist; - // }); - it('should be an object', function() { dog.should.be.an('object'); expect(dog).to.exist; From 905e986817ed44621ca1c5559bd172e57a053458 Mon Sep 17 00:00:00 2001 From: sgnl Date: Mon, 9 Nov 2015 11:38:55 -1000 Subject: [PATCH 5/5] update travis-ci to use new npm script --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee6bef2..e03dd20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ sudo: false node_js: - 0.12 script: - - npm run karma \ No newline at end of file + - npm run test \ No newline at end of file