当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript SinonStub.calledWith方法代码示例

本文整理汇总了TypeScript中Sinon.SinonStub.calledWith方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SinonStub.calledWith方法的具体用法?TypeScript SinonStub.calledWith怎么用?TypeScript SinonStub.calledWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sinon.SinonStub的用法示例。


在下文中一共展示了SinonStub.calledWith方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

 it('should use null scope when none of the above is provided (but the rest is)', async () => {
   await account.getAll({ address: '1' }, [
     'username',
     'isDelegate',
     'secondSignature',
     'address',
     'publicKey',
     'secondPublicKey',
     'balance',
     'vote',
     'rate',
     'multimin',
     'multilifetime',
     'blockId',
     'producedblocks',
     'missedblocks',
     'fees',
     'rewards',
     'virgin',
     'u_isDelegate',
     'u_secondSignature',
     'u_username',
     'u_balance',
     'u_multilifetime',
     'u_multimin',
   ]);
   expect(scopeStub.calledWith(null)).is.true;
 });
开发者ID:RiseVision,项目名称:rise-node,代码行数:28,代码来源:account.spec.ts

示例2: expect

 return transport.sendEvent(payload).catch(res => {
   expect(res.status).equal(403);
   expect(fetch.calledOnce).equal(true);
   expect(
     fetch.calledWith(transportUrl, {
       body: JSON.stringify(payload),
       method: 'POST',
       referrerPolicy: 'origin',
     }),
   ).equal(true);
 });
开发者ID:getsentry,项目名称:raven-js,代码行数:11,代码来源:fetch.test.ts

示例3: unloadTasks

		unloadTasks();
	},

	beforeEach() {
		symlink.reset();
		shell.reset();
	},

	_link() {
		runGruntTask('_link');

		assert.isTrue(symlink.calledTwice);
		assert.isTrue(symlink.firstCall.calledWith(path.join(cwd, 'node_modules'), path.join(outputPath, 'node_modules'), 'junction'));
		assert.isTrue(symlink.secondCall.calledWith(path.join(cwd, 'package.json'), path.join(outputPath, 'package.json'), 'file'));
		assert.isTrue(shell.calledOnce);
		assert.isTrue(shell.calledWith('npm link', { cwd: outputPath }));
	},

	link: {
		beforeEach() {
			run = stub(grunt.task, 'run');
		},
		afterEach() {
			run.restore();
		},

		withDir() {
			prepareOutputDirectory();

			runGruntTask('link');
开发者ID:dylans,项目名称:grunt-dojo2,代码行数:30,代码来源:link.ts

示例4: stub

			grunt.initConfig({});
			mockLogger = stub(grunt.log, 'error');
			mockShell = stub();

			mockShell
			.withArgs('npm install my-dep@"1.0"').returns(Promise.resolve({}))
			.withArgs('npm install error-dep@"1.0"').throws();

			loadTasks({
				child_process: {
					execSync: mockShell
				}
			}, {
				peerDependencies: {
					'my-dep': '1.0',
					'error-dep': '1.0'
				}
			});
		},
		runsCommands() {
			runGruntTask('peerDepInstall');

			assert.isTrue(mockShell.calledTwice);
			assert.isTrue(mockShell.calledWith('npm install my-dep@"1.0"'));
			assert.isTrue(mockShell.calledWith('npm install error-dep@"1.0"'));
			assert.isTrue(mockLogger.called);
			assert.isTrue(mockLogger.calledWith('failed.'));
		}
	}
});
开发者ID:dylans,项目名称:grunt-dojo2,代码行数:30,代码来源:installPeerDependencies.ts

示例5: dist

	dist() {
		runGruntTask('dojo-ts:dist');

		assert.deepEqual(grunt.config('ts.dist'), {
			tsconfig: {
				passThrough: true,
				tsconfig: '.tsconfigdist.json'
			}
		});

		assert.isTrue(run.calledOnce);
		assert.deepEqual(run.firstCall.args[ 0 ], [ 'ts:dist', 'clean:distTsconfig' ]);

		assert.isTrue(write.calledOnce);
		assert.isTrue(write.calledWith('.tsconfigdist.json'));
	},

	esm() {
		grunt.initConfig({
			distDirectory: outputPath,
			tsconfig: {
				"compilerOptions": {
					"inlineSourceMap": true,
					"inlineSources": true,
					"listFiles": true,
					"module": "commonjs",
					"noImplicitAny": true,
					"pretty": true,
					"target": "es6"
				}
开发者ID:dylans,项目名称:grunt-dojo2,代码行数:30,代码来源:ts.ts

示例6: getGroupMap

					await yargsStub.command.firstCall.args[3]({ _: ['group'] });
					assert.isTrue(consoleErrorStub.calledOnce);
					assert.isTrue(consoleErrorStub.firstCall.calledWithMatch(errorMessage));
					assert.isTrue(processExitStub.called);
				},
				async 'Should exit process with exitCode of 1 when no exitCode is returned'() {
					groupMap = getGroupMap([
						{
							groupName: 'group1',
							commands: [{ commandName: 'command1', fails: true }]
						}
					]);
					registerCommands(yargsStub, groupMap);
					await yargsStub.command.firstCall.args[3]({ _: ['group'] });
					assert.isTrue(processExitStub.calledOnce);
					assert.isTrue(processExitStub.calledWith(1));
				},
				async 'Should exit process with passed exit code'() {
					groupMap = getGroupMap([
						{
							groupName: 'group1',
							commands: [{ commandName: 'command1', fails: true, exitCode: 100 }]
						}
					]);
					registerCommands(yargsStub, groupMap);
					await yargsStub.command.firstCall.args[3]({ _: ['group'] });
					assert.isTrue(processExitStub.calledOnce);
					assert.isTrue(processExitStub.calledWith(100));
				}
			}
		}
开发者ID:dojo,项目名称:cli,代码行数:31,代码来源:registerCommands.ts


注:本文中的Sinon.SinonStub.calledWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。