diff --git a/.bithoundrc b/.bithoundrc new file mode 100644 index 0000000..76f218e --- /dev/null +++ b/.bithoundrc @@ -0,0 +1,6 @@ +{ + "ignore": [ + "**/node_modules/**", + "**/test/**" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 1410034..3cd9b32 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,14 @@

npm version Travis + bitHound Code + bitHound Overall Score Coverage Known Vulnerabilities dependencies status + bitHound Dependencies devDependencies status + bitHound Dev Dependencies

I had two motivations behind Tamarin. The first was to convert the steps behind my cucumber tests from ruby to javascript _(It seems these days that the front-end javascript developers end up maintaining the ruby steps .... and they hate it!)_ and the second was to simplify those steps to only include the actual tests and not all that extra code just to make the tests work consistently. diff --git a/package.json b/package.json index 081c1f3..03eb579 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tamarin", - "version": "1.0.19", + "version": "1.0.20", "description": "Tamarin cucumber.js world extensions", "main": "index.js", "bin": "./bin/tamarin.js", diff --git a/test/world.spec.js b/test/world.spec.js index 19783ab..c00cb20 100644 --- a/test/world.spec.js +++ b/test/world.spec.js @@ -16,9 +16,11 @@ const expect = chai.expect describe('world class', function () { const dummyDriver = { - findElement: () => {}, + findElement: () => { + }, executeScript: () => ({ - bind: () => {} + bind: () => { + } }) } @@ -65,11 +67,11 @@ describe('world class', function () { describe('can be extended', function () { class World extends TamarinWorld { - setTestVal (val) { + setTestVal(val) { this.setData('test', val) } - getTestVal () { + getTestVal() { return this.getData('test') } } @@ -101,25 +103,23 @@ describe('world class', function () { describe('can be extended with use', function () { const MyWorld = (World) => (() => { class ExtendedWorld extends World { - setTestVal (val) { - this.setData('test', val) + setBlahVal(val) { + this.setData('blah', val) } - getTestVal () { - return this.getData('test') + getBlahVal() { + return this.getData('blah') } } return ExtendedWorld })() - TamarinWorld.use(MyWorld) - - class World extends TamarinWorld { - setTestVal (val) { + class World extends TamarinWorld.use(MyWorld) { + setTestVal(val) { this.setData('test', val) } - getTestVal () { + getTestVal() { return this.getData('test') } } @@ -139,12 +139,16 @@ describe('world class', function () { it('should be context free', function () { const worldA = new World(dummyDriver) worldA.setTestVal('barfoo') + worldA.setBlahVal('barfooblah') const worldB = new World(dummyDriver) worldB.setTestVal('foobar') + worldB.setBlahVal('foobarblah') expect(worldA.getTestVal()).to.eventually.equal('barfoo') expect(worldB.getTestVal()).to.eventually.equal('foobar') + expect(worldA.getBlahVal()).to.eventually.equal('barfooblah') + expect(worldB.getBlahVal()).to.eventually.equal('foobarblah') }) }) @@ -152,7 +156,8 @@ describe('world class', function () { let World, world, driver, el, cookie, corRoutines beforeEach(function () { - sinon.stub(console, 'error').returns(() => {}) + sinon.stub(console, 'error').returns(() => { + }) el = { sendKeys: () => Promise.resolve(el), hover: () => Promise.resolve(el),