mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add stricter object checking
This commit is contained in:
@@ -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", ->
|
||||
|
||||
Reference in New Issue
Block a user