當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ava.skip函數代碼示例

本文整理匯總了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');
});
開發者ID:sindresorhus,項目名稱:got,代碼行數:30,代碼來源:redirects.ts

示例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() {
開發者ID:bvkimball,項目名稱:linguist,代碼行數:32,代碼來源:ServiceParser.spec.ts

示例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']);
});
開發者ID:bvkimball,項目名稱:linguist,代碼行數:29,代碼來源:PipeParser.spec.ts

示例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();
});
開發者ID:bvkimball,項目名稱:linguist,代碼行數:29,代碼來源:LumberJack.spec.ts

示例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);
});
開發者ID:bvkimball,項目名稱:linguist,代碼行數:30,代碼來源:XliffCompiler.spec.ts

示例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);
});
開發者ID:sindresorhus,項目名稱:got,代碼行數:21,代碼來源:socket-destroyed.ts

示例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')
})
開發者ID:unional,項目名稱:ava-fixture,代碼行數:30,代碼來源:fixture.skip.spec.ts


注:本文中的ava.skip函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。