Skip to content

Commit

Permalink
Skip Vector.prototype[Symbol.toStringTag] test in old env
Browse files Browse the repository at this point in the history
  • Loading branch information
broadsw0rd committed Jul 23, 2016
1 parent 5d62cc3 commit dffd49e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/convertion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ test('`Vector#toString()` should convert self to JSON', function (t) {
t.is(result, '1.000 2.000')
})

test('`Vector.prototype[Symbol.toStringTag]` should specified [object ___] stringification', function (t) {
var vector = new Vector(1, 2)
var result = Object.prototype.toString.call(vector)
t.is(result, '[object Vector]')
})
if (typeof Symbol !== 'undefined' && Symbol.toStringTag && Vector.prototype[Symbol.toStringTag]) {
test('`Vector.prototype[Symbol.toStringTag]` should specified [object ___] stringification', function (t) {
var vector = new Vector(1, 2)
var result = Object.prototype.toString.call(vector)
t.is(result, '[object Vector]')
})
} else {
test.skip('`Vector.prototype[Symbol.toStringTag]` should specified [object ___] stringification', function (t) {})
}

test('`Vector.toArray(vector)` should convert passed vector to array', function (t) {
var vector = new Vector(1, 2)
Expand Down

0 comments on commit dffd49e

Please sign in to comment.