Enforce codestyle
This commit is contained in:
@@ -4,34 +4,34 @@ import 'mocha'
|
||||
|
||||
describe('Edge', () => {
|
||||
it('should contain a name', () => {
|
||||
let e = new Edge('foo')
|
||||
expect(e.name).to.equal('foo')
|
||||
});
|
||||
const e = new Edge('foo')
|
||||
expect(e.name).to.equal('foo')
|
||||
})
|
||||
|
||||
it('firstEdge should retireve the first edge', () => {
|
||||
const topics = 'foo/bar/baz'.split('/')
|
||||
const leaf = TreeNodeFactory.fromEdgesAndValue(topics, 5)
|
||||
let bazEdge = leaf.sourceEdge
|
||||
const bazEdge = leaf.sourceEdge
|
||||
|
||||
if (!bazEdge) {
|
||||
expect.fail('should not be undefined')
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
expect(bazEdge.name).to.eq('baz')
|
||||
expect(bazEdge.firstEdge().name).to.eq('foo')
|
||||
});
|
||||
})
|
||||
|
||||
it('hash should not be empty', () => {
|
||||
let e = new Edge('bar')
|
||||
expect(e.hash().length).to.be.gt(0)
|
||||
});
|
||||
const e = new Edge('bar')
|
||||
expect(e.hash().length).to.be.gt(0)
|
||||
})
|
||||
|
||||
it('hash should be stable', () => {
|
||||
let e = new Edge('bar')
|
||||
let previousHash = e.hash()
|
||||
expect(e.hash()).to.eq(previousHash)
|
||||
});
|
||||
const e = new Edge('bar')
|
||||
const previousHash = e.hash()
|
||||
expect(e.hash()).to.eq(previousHash)
|
||||
})
|
||||
|
||||
it('hash should include change if parents are different', () => {
|
||||
const topics1 = 'foo/bar/baz'.split('/')
|
||||
@@ -45,5 +45,5 @@ describe('Edge', () => {
|
||||
}
|
||||
|
||||
expect(bazEdge1.hash()).to.not.eq(bazEdge2.hash())
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user