本文整理汇总了TypeScript中ava.skip函数的典型用法代码示例。如果您正苦于以下问题:TypeScript skip函数的具体用法?TypeScript skip怎么用?TypeScript skip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skip函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
});
test('throws on invalid redirect URL', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
response.writeHead(302, {
location: 'http://'
});
response.end();
});
await t.throwsAsync(got(''), {
code: 'ERR_INVALID_URL'
});
});
// TODO: Enable this again when https://github.com/nock/nock/issues/1509 is fixed
// eslint-disable-next-line ava/no-skip-test
test.skip('port is reset on redirect', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
response.writeHead(307, {
location: 'http://localhost'
});
response.end();
});
nock('http://localhost').get('/').reply(200, 'ok');
const {body} = await got('');
t.is(body, 'ok');
});
示例2: constructor
export class AppComponent {
public constructor(protected _translateService: TranslateService) { }
public test() {
this._translateService.translate('Hello World');
}
`;
const keys = parser.extract(contents, componentFilename).keys();
t.deepEqual(keys, ['Hello World']);
});
test.skip('should extract array of strings in TranslateService\'s translate() method', async t => {
const contents = `
@Component({ })
export class AppComponent {
public constructor(protected _translateService: TranslateService) { }
public test() {
this._translateService.translate(['Hello', 'World']);
}
`;
const keys = parser.extract(contents, componentFilename).keys();
t.deepEqual(keys, ['Hello', 'World']);
});
test('should extract strings with liberal spacing', async t => {
const contents = `
@Component({ })
export class AppComponent {
public constructor(
protected _translateService: TranslateService,
protected _otherService: OtherService
) { }
public test() {
示例3: test
test('should only extract string using pipe', async t => {
const contents = `<button [style.background]="'lime'">{{ 'SomeKey_NotWorking' | translate }}</button>`;
const keys = parser.extract(contents, templateFilename).keys();
t.deepEqual(keys, ['SomeKey_NotWorking']);
});
test('should extract interpolated strings using translate pipe', async t => {
const contents = `Hello {{ 'World' | translate }}`;
const keys = parser.extract(contents, templateFilename).keys();
t.deepEqual(keys, ['World']);
});
test.skip('should extract strings with escaped quotes', async t => {
const contents = `Hello {{ 'World\'s largest potato' | translate }}`;
const keys = parser.extract(contents, templateFilename).keys();
t.deepEqual(keys, [`World's largest potato`]);
});
test('should extract interpolated strings using translate pipe in attributes', async t => {
const contents = `<span attr="{{ 'Hello World' | translate }}"></span>`;
const keys = parser.extract(contents, templateFilename).keys();
t.deepEqual(keys, ['Hello World']);
});
test('should extract bound strings using translate pipe in attributes', async t => {
const contents = `<span [attr]="'Hello World' | translate"></span>`;
const keys = parser.extract(contents, templateFilename).keys();
t.deepEqual(keys, ['Hello World']);
});
示例4: test
test('should display warning messages', async t => {
Logger.warn('Warning!!!');
t.pass();
});
test('should display success messages', async t => {
Logger.success('You did it!');
t.pass();
});
test('should display log error messages', async t => {
Logger.error('Error...');
t.pass();
});
test('should display spinner', async t => {
Logger.spin('processing...');
t.pass();
});
test('should display log error messages', async t => {
Logger.stop();
t.pass();
});
test.skip('should clear messages', async t => {
Logger.clear();
t.pass();
});
示例5: Translations
});
});
let XML: string = `<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en-US" target-language="en-US" datatype="plaintext" original="messages" product-name="@bullhorn/linguist">
<body>
<trans-unit id="FIRST_KEY" datatype="html">
<source>One</source>
<target/>
</trans-unit>
<trans-unit id="SECOND_KEY" datatype="html">
<source>Two</source>
<target/>
</trans-unit>
</body>
</file>
</xliff>`;
let KEYS: any = {'FIRST_KEY': 'One', 'SECOND_KEY': 'Two' };
test.skip('should convert to json keys on parse', async t => {
const collection: Translations = compiler.parse(XML);
t.deepEqual(collection.values, KEYS);
});
test('should convert to xliff xml on compile', async t => {
const collection = new Translations(KEYS);
const result: string = compiler.compile(collection);
t.deepEqual(result, XML);
});
示例6:
import test from 'ava';
import got from '../source';
// TODO: Use `getActiveResources()` instead of `process.binding('timer_wrap')` when it's out:
// https://github.com/nodejs/node/pull/21453
// eslint-disable-next-line ava/no-skip-test
test.skip('clear the progressInterval if the socket has been destroyed', async t => {
// @ts-ignore
const {Timer} = process.binding('timer_wrap'); // eslint-disable-line node/no-deprecated-api
await t.throwsAsync(got('http://127.0.0.1:55555', {retry: 0}), {
code: 'ECONNREFUSED'
});
// @ts-ignore
const progressIntervalTimer = process._getActiveHandles().filter(handle => {
// Check if the handle is a Timer that matches the `uploadEventFrequency` interval
return handle instanceof Timer && handle._list.msecs === 150;
});
t.is(progressIntervalTimer.length, 0);
});
示例7: Error
// throw new Error('should not run before')
// })
ava.beforeEach(() => {
throw new Error('should not run beforeEach')
})
// ava.after(() => {
// throw new Error('should not run after')
// })
ava.afterEach(() => {
throw new Error('should not run after each')
})
ava.skip('skip test', _t => {
throw new Error('should not run ava skip')
})
ftest.skip('case-1', _t => {
throw new Error('should not run ftest.skip')
})
ftest.skip.each(_t => {
throw new Error('should not run')
})
ftest.skip.each.failing(_t => {
throw new Error('should not run')
})