Skip to content

Commit

Permalink
Added test for default indexer for World
Browse files Browse the repository at this point in the history
Now has 100% test coverage
  • Loading branch information
ayebear committed Nov 21, 2019
1 parent c642630 commit 1317ac5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/world.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { World } = require('../index.js')
const { Entity } = require('./entity.js')
const {
getSize,
Expand All @@ -6,6 +7,12 @@ const {
assert
} = require('./test_utils.js')

test('world: create a world', () => {
const world = new World()
assert(world instanceof World)
assert(typeof world.component === 'function')
})

test('component: define a component', testIndexers(world => {
world.component('position', function(entity, x = 0, y = 0) {
this.x = x
Expand Down

0 comments on commit 1317ac5

Please sign in to comment.