/
kopython
/
_hyperscript
Обзор
Документация
Войти
/
kopython
/
_hyperscript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/expressions/typecheck.js
36 строк
1 KB
Deniz Akşimşek
Add .editorconfig and format everything (everything)
27 май 2021, 19:44
27 май 2021, 19:44
061681f
Код
Авторство
О чём код?
describe("the typecheck expression", function () { it("can do basic string typecheck", function () { var result = evalHyperScript("'foo' : String"); result.should.equal("foo"); }); it("can do null as string typecheck", function () { var result = evalHyperScript("null : String"); should.equal(result, null); }); it("can do basic non-string typecheck failure", function () { try { var result = evalHyperScript("true : String"); throw new Error("should not reach"); } catch (e) { console.log(e.message); e.message.indexOf("Typecheck failed!").should.equal(0); } }); it("can do basic string non-null typecheck", function () { var result = evalHyperScript("'foo' : String!"); result.should.equal("foo"); }); it("null causes null safe string check to fail", function () { try { var result = evalHyperScript("null : String!"); throw new Error("should not reach"); } catch (e) { console.log(e.message); e.message.indexOf("Typecheck failed!").should.equal(0); } }); });