Add stricter object checking

This commit is contained in:
Kevin Sawicki
2015-07-07 12:20:01 -07:00
parent 7fbcd147d5
commit 93069fad75
2 changed files with 5 additions and 1 deletions

View File

@@ -8,16 +8,19 @@ describe "Notification", ->
expect(-> new Notification('error', 3)).toThrow()
expect(-> new Notification('error', {})).toThrow()
expect(-> new Notification('error', false)).toThrow()
expect(-> new Notification('error', [])).toThrow()
it "throws an error when created with non-object options", ->
expect(-> new Notification('error', 'message', 'foo')).toThrow()
expect(-> new Notification('error', 'message', 3)).toThrow()
expect(-> new Notification('error', 'message', false)).toThrow()
expect(-> new Notification('error', 'message', [])).toThrow()
it "throws an error when created with a non-string detail", ->
expect(-> new Notification('error', 'message', detail: 3)).toThrow()
expect(-> new Notification('error', 'message', detail: false)).toThrow()
expect(-> new Notification('error', 'message', detail: {})).toThrow()
expect(-> new Notification('error', 'message', detail: [])).toThrow()
describe "::getTimestamp()", ->
it "returns a Date object", ->