本文整理匯總了TypeScript中power-assert類的典型用法代碼示例。如果您正苦於以下問題:TypeScript power-assert類的具體用法?TypeScript power-assert怎麽用?TypeScript power-assert使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了power-assert類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it ('add cell', () => {
var list = new List();
list.add(10);
assert(list.get(0) === 10);
});
示例2: glob
glob('./.tmp/generated/**/*.md', (err, fileNames) => {
assert(fileNames.length === 0);
done();
});
示例3: Future
return Future(() => 1).flatMap(x => Future(() => x + 1)).promise.then(x => assert(x === 2));
示例4: hello
it("generate string with parameter", () => {
let str = hello("JavaScript");
assert(str === "Hello, JavaScript");
});
示例5: it
it('should be return new instance', () => {
assert(post instanceof Post)
})
示例6: assert
c.once('shiba:return-lint-rule-url', (_: any, url: string) => {
assert(url.indexOf('http') === 0);
done();
});
示例7: it
it(`extracts "endpoint" from ${name}`, () => {
assert(GitHubApi.extractEndpoint(url) === "https://api.github.com");
});
示例8: assert
}, done, (x) => {
assert(x === 3)
done()
})