Skip to content

Commit

Permalink
Bump up version and adhere to bithound
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaxscape committed Nov 19, 2016
1 parent 17c4a04 commit 21744d8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .bithoundrc
@@ -0,0 +1,6 @@
{
"ignore": [
"**/node_modules/**",
"**/test/**"
]
}
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -3,10 +3,14 @@
<p align="left">
<a href="https://www.npmjs.com/package/tamarin"><img src="https://img.shields.io/npm/v/tamarin.svg" alt="npm version"></a>
<a href="https://travis-ci.org/ajaxscape/tamarin"><img src="https://img.shields.io/travis/ajaxscape/tamarin/master.svg" alt="Travis"></a>
<a href="https://www.bithound.io/github/ajaxscape/tamarin"><img src="https://www.bithound.io/github/ajaxscape/tamarin/badges/code.svg" alt="bitHound Code"></a>
<a href="https://www.bithound.io/github/ajaxscape/tamarin"><img src="https://www.bithound.io/github/ajaxscape/tamarin/badges/score.svg" alt="bitHound Overall Score"></a>
<a href="https://coveralls.io/github/ajaxscape/tamarin"><img src="https://coveralls.io/repos/github/ajaxscape/tamarin/badge.svg" alt="Coverage"></a>
<a href="https://snyk.io/test/npm/tamarin"><img src="https://snyk.io/test/npm/tamarin/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/npm/tamarin" style="max-width:100%;"></a>
<a href="https://david-dm.org/ajaxscape/tamarin"><img src="https://david-dm.org/ajaxscape/tamarin/status.svg" alt="dependencies status"></a>
<a href="https://www.bithound.io/github/ajaxscape/tamarin/master/dependencies/npm"><img src="https://www.bithound.io/github/ajaxscape/tamarin/badges/dependencies.svg" alt="bitHound Dependencies"></a>
<a href="https://david-dm.org/ajaxscape/tamarin"><img src="https://david-dm.org/ajaxscape/tamarin/dev-status.svg" alt="devDependencies status"></a>
<a href="https://www.bithound.io/github/ajaxscape/tamarin/master/dependencies/npm"><img src="https://www.bithound.io/github/ajaxscape/tamarin/badges/devDependencies.svg" alt="bitHound Dev Dependencies"></a>
</p>

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.
Expand Down
2 changes: 1 addition & 1 deletion 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",
Expand Down
33 changes: 19 additions & 14 deletions test/world.spec.js
Expand Up @@ -16,9 +16,11 @@ const expect = chai.expect

describe('world class', function () {
const dummyDriver = {
findElement: () => {},
findElement: () => {
},
executeScript: () => ({
bind: () => {}
bind: () => {
}
})
}

Expand Down Expand Up @@ -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')
}
}
Expand Down Expand Up @@ -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')
}
}
Expand All @@ -139,20 +139,25 @@ 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')
})
})

describe('method', 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),
Expand Down

0 comments on commit 21744d8

Please sign in to comment.