Skip to content
Permalink
Browse files

8-building-a-library

  • Loading branch information...
codebryo committed Feb 4, 2019
1 parent 62e3573 commit 8e47a510dfbb0762687a4efa28eace33e7f8ddc3
Showing with 26 additions and 0 deletions.
  1. +11 −0 8-building-a-library/model.js
  2. +15 −0 8-building-a-library/model.spec.js
@@ -0,0 +1,11 @@
export default class Model {

constructor() {
this.$collection = []
}

record() { }
all() { }
update() { }
find() { }
}
@@ -0,0 +1,15 @@
import Model from './model'

test('new works', () => {
expect(new Model).toBeInstanceOf(Model)
})

test('model structure', () => {
expect(new Model).toEqual(expect.objectContaining({
$collection: expect.any(Array),
record: expect.any(Function),
all: expect.any(Function),
find: expect.any(Function),
update: expect.any(Function),
}))
})

0 comments on commit 8e47a51

Please sign in to comment.
You can’t perform that action at this time.