Lines Matching refs:expect
10 expect(runtime.global) !== nil in spec()
16 expect(undefined.isUndefined()) == true in spec()
17 expect(undefined.kind) == .undefined in spec()
18 expect(undefined.isNull()) == false in spec()
19 expect(undefined.getRaw()).to(beNil()) in spec()
24 expect(null.isNull()) == true in spec()
25 expect(null.kind) == .null in spec()
26 expect(null.getRaw()).to(beNil()) in spec()
32 expect(boolTrue.isBool()) == true in spec()
33 expect(boolFalse.isBool()) == true in spec()
34 expect(boolTrue.kind) == .bool in spec()
35 expect(boolFalse.kind) == .bool in spec()
36 expect(try! boolTrue.asBool()) == true in spec()
37 expect(try! boolFalse.asBool()) == false in spec()
42 expect(number.isNumber()) == true in spec()
43 expect(number.kind) == .number in spec()
44 expect(try! number.asInt()) == 1 in spec()
45 expect(try! number.asDouble()) == 1.23 in spec()
50 expect(string.isString()) == true in spec()
51 expect(string.kind) == .string in spec()
52 expect(try! string.asString()) == "foobar" in spec()
57 expect(array.isObject()) == true in spec()
58 expect(array.kind) == .object in spec()
59 expect(try! array.asArray().map { try $0?.asString() }) == ["foo", "bar"] in spec()
65 expect(dict1.isObject()) == true in spec()
66 expect(dict2.isObject()) == true in spec()
67 expect(dict1.kind) == .object in spec()
68 expect(dict2.kind) == .object in spec()
69 expect(try! dict1.asDict() as? [String: Int]) == ["foo": 123] in spec()
70 expect(try! dict2.asDict() as? [String: String]) == ["foo": "bar"] in spec()
75 expect(function.isObject()) == true in spec()
76 expect(function.isFunction()) == true in spec()
77 expect(function.kind) == .function in spec()
82 expect(symbol.isSymbol()) == true in spec()
83 expect(symbol.kind) == .symbol in spec()
87 expect({ try runtime.eval("foo") }).to(throwError { error in in spec()
88 expect(error).to(beAKindOf(JavaScriptEvalException.self)) in spec()
90 … expect((error as! JavaScriptEvalException).reason).to(contain("Property 'foo' doesn't exist")) in spec()
92 expect((error as! JavaScriptEvalException).reason).to(contain("Can't find variable: foo")) in spec()