本文整理汇总了TypeScript中chai.assert.notInclude方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.notInclude方法的具体用法?TypeScript assert.notInclude怎么用?TypeScript assert.notInclude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.notInclude方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('compiles ES2017 to ES2015', async () => {
const result = jsTransform(
'async function test() { await 0; }', {compile: 'es2015'});
assert.include(result, 'asyncToGenerator');
assert.notInclude(result, 'async function test');
assert.notInclude(result, 'regeneratorRuntime');
});
示例2: test
test('compiles ES2017 to ES2015', async () => {
const sourceStream = createFakeFileStream([
{
path: 'foo.js',
contents: `async function test() { await 0; }`,
},
]);
const op = pipeStreams(
[sourceStream, getOptimizeStreams({js: {compile: 'es2015'}})]);
const result = await getOnlyFile(op);
assert.include(result, 'asyncToGenerator');
assert.notInclude(result, 'async function test');
assert.notInclude(result, 'regeneratorRuntime');
});
示例3: done
.on('end', () => {
const expectedJoinedFiles = [
'index.html',
'shell.html',
path.join('source-dir', 'my-app.html'),
];
assert.deepEqual(
Array.from(joinedFiles.keys()).sort(), expectedJoinedFiles);
const shell = joinedFiles.get('shell.html').contents.toString();
assert.notInclude(shell, '<html', 'html element was added');
assert.notInclude(shell, '<head', 'head element was added');
assert.notInclude(shell, '<body', 'body element was added');
done();
});
示例4: test
test('creates a filesystem path using the platform separators', () => {
const otherSeparator = pathSeparator === '/' ? '\\' : '/';
const path =
pathFromUrl(RootPath, '/some/url/pathname' as PackageRelativeUrl);
assert.include(path, pathSeparator);
assert.notInclude(path, otherSeparator);
});
示例5: test
test('add prefetch links for transitive deps of bundled', async () => {
const project = new PolymerProject({
root: 'test-fixtures/bundle-project/',
entrypoint: 'index.html',
fragments: ['simple-import.html'],
});
const files = await emittedFiles(
mergeStream(project.sources(), project.dependencies())
.pipe(project.bundler({inlineScripts: false}))
.pipe(project.addPrefetchLinks()),
project.config.root);
const expectedFiles =
['index.html', 'simple-import.html', 'simple-script.js'];
assert.deepEqual(expectedFiles, [...files.keys()].sort());
const html = files.get('index.html')!.contents!.toString();
// `simple-import.html` is a direct dependency, so we should not add
// prefetch link to it.
assert.notInclude(
html, '<link rel="prefetch" href="/simple-import.html">');
// `simple-import.html` has inlined `simple-import-2.html` which has an
// external script import `simple-script.js`. A prefetch link is added
// for `simple-script.js` because it is a transitive dependency of the
// `index.html`
assert.include(html, '<link rel="prefetch" href="/simple-script.js">');
});
示例6: test
test('adds prefetch links for transitive deps of unbundled', async () => {
const project = new PolymerProject({
root: 'test-fixtures/bundle-project/',
entrypoint: 'index.html',
});
const files = await emittedFiles(
mergeStream(project.sources(), project.dependencies())
.pipe(project.addPrefetchLinks()),
project.config.root);
const html = files.get('index.html').contents.toString();
// No prefetch links needed for direct dependency.
assert.notInclude(
html, '<link rel="prefetch" href="/simple-import.html">');
// Prefetch added for the transitive dependencies of `index.html`,
// which are all direct dependencies of `simple-import.html`.
assert.include(html, '<link rel="prefetch" href="/simple-script.js">');
assert.include(html, '<link rel="prefetch" href="/simple-style.css">');
assert.include(
html, '<link rel="prefetch" href="/simple-import-2.html">');
});
示例7: it
it("doesn't warn if non-existent file is excluded by --exclude", async () => {
const result = await execRunnerWithOutput({
exclude: ["**/*.js"],
files: ["foo/bar.js"],
});
assert.strictEqual(result.status, Status.Ok, "process should exit without error");
assert.notInclude(result.stderr, "does not exist");
});
示例8: done
.on('end', () => {
const expectedFiles = [
'index.html',
'shell.html',
];
assert.deepEqual(Array.from(files.keys()).sort(), expectedFiles);
const index = files.get('index.html').contents.toString();
assert.include(index, 'index stuff');
assert.include(index, '<base href="/newBase/">');
assert.notInclude(index, 'oldBase');
const shell = files.get('shell.html').contents.toString();
assert.include(shell, 'shell stuff');
assert.include(shell, 'shell-stuff/');
assert.notInclude(shell, 'newBase');
done();
});