本文整理匯總了TypeScript中vsts-task-lib/mock-test.MockTestRunner.ran方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MockTestRunner.ran方法的具體用法?TypeScript MockTestRunner.ran怎麽用?TypeScript MockTestRunner.ran使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vsts-task-lib/mock-test.MockTestRunner
的用法示例。
在下文中一共展示了MockTestRunner.ran方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('Positive path: upload UITest with username and password', (done: MochaDone) => {
this.timeout(2000);
let tp = path.join(__dirname, 'L0UITestPass.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
assert(tr.succeeded, 'task should have succeeded');
assert(tr.invokedToolCount === 4, 'Should have run login, logout, test prepare and test run');
assert(tr.ran("/path/to/mobile-center login -u MyUsername -p MyPassword --quiet"),
"Should have run login");
assert(tr.ran("/path/to/mobile-center logout --quiet"),
"Should have run logout");
assert(tr.ran("/path/to/mobile-center test prepare uitest --artifacts-dir " +
"/path/to/artifactsDir --app-path /test/path/to/my.ipa --build-dir /path/to/uitest_build_dir --myopts --quiet"),
"Should have run prepare");
assert(tr.ran("/path/to/mobile-center test run manifest " +
"--manifest-path /path/to/artifactsDir/manifest.json --app-path " +
"/test/path/to/my.ipa --app testuser/testapp --devices 1234abcd " +
"--test-series master --dsym-dir /path/to/dsym --locale nc_US --quiet"),
"Should have run test run");
done();
});
示例2: it
it('Xcode 8 create IPA with bad exportOptionsPlist path', (done:MochaDone) => {
this.timeout(1000);
let tp = path.join(__dirname, 'L0ExportOptionsPlistBadPath.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
//version
assert(tr.ran('/home/bin/xcodebuild -version'), 'xcodebuild for version should have been run.');
//build
assert(tr.ran('/home/bin/xcodebuild -sdk $(SDK) -configuration $(Configuration) ' +
'-workspace /user/build/fun.xcodeproj/project.xcworkspace -scheme testScheme build ' +
'DSTROOT=/user/build/output/$(SDK)/$(Configuration)/build.dst ' +
'OBJROOT=/user/build/output/$(SDK)/$(Configuration)/build.obj ' +
'SYMROOT=/user/build/output/$(SDK)/$(Configuration)/build.sym ' +
'SHARED_PRECOMPS_DIR=/user/build/output/$(SDK)/$(Configuration)/build.pch'),
'xcodebuild for building the ios project/workspace should have been run.');
//archive
assert(tr.ran('/home/bin/xcodebuild -workspace /user/build/fun.xcodeproj/project.xcworkspace -scheme testScheme ' +
'archive -sdk $(SDK) -configuration $(Configuration) -archivePath /user/build/testScheme'),
'xcodebuild archive should have been run to create the .xcarchive.');
assert(tr.invokedToolCount == 3, 'should have run xcodebuild for version, build, and archive.');
assert(tr.failed, 'task should have failed');
assert(tr.stdout.indexOf('vso[task.issue type=error;]loc_mock_ExportOptionsPlistInvalidFilePath') >=0,
'Build should show error indicating invalid Plist file path.');
done();
});
示例3: it
it('macOS provisionless auto export', function (done: MochaDone) {
this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000);
const tp = path.join(__dirname, 'L0macOSProvisionlessAutoExport.js');
const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
//version
assert(tr.ran('/home/bin/xcodebuild -version'), 'xcodebuild for version should have been run.');
//export prep
assert(tr.ran("/usr/libexec/PlistBuddy -c Clear _XcodeTaskExportOptions.plist"),
'PlistBuddy Clear should have run. An empty exportOptions plist should be used when there\'s not an embedded provisioning profile.');
//export
assert(tr.ran('/home/bin/xcodebuild -exportArchive -archivePath /user/build/testScheme.xcarchive'
+' -exportPath /user/build -exportOptionsPlist _XcodeTaskExportOptions.plist'),
'xcodebuild exportArchive should have been run to export the IPA from the .xcarchive');
assert(tr.stderr.length === 0, 'should not have written to stderr');
assert(tr.succeeded, 'task should have succeeded');
assert(tr.invokedToolCount === 6, 'Should have ran 6 command lines.');
done();
});
示例4: it
it('No Code Coverage results fail', function (done) {
let tp: string = path.join(__dirname, 'L0NoCodeCoverageFail.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
try {
createTemporaryFolders();
let testStgDir: string = path.join(__dirname, '_temp');
tr.run();
assert(tr.failed, 'task should have failed');
assert(tr.invokedToolCount === 2, 'should have only run gradle 2 times');
assert(tr.stderr.length === 0, 'should not have written to stderr');
assert(tr.stdout.indexOf('loc_mock_NoCodeCoverage') > -1, 'should have given an error message');
assert(tr.ran(gradleWrapper + ` properties`), 'should have run Gradle with properties');
assert(tr.ran(gradleWrapper + ` clean build jacocoTestReport`), 'should have run Gradle with code coverage');
cleanTemporaryFolders();
done();
} catch (err) {
console.log(tr.stdout);
console.log(tr.stderr);
console.log(err);
done(err);
}
});
示例5: it
it('Xplat MSBuild: Multiple solutions', (done: MochaDone) => {
this.timeout(1000);
let tp: string = path.join(__dirname, 'L0MSBuildMultipleSolutions.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
//clean
assert(tr.ran('/home/bin/xbuild /user/build/fun.sln /t:Clean /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
'/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild clean should have been run on the solution.');
assert(tr.ran('/home/bin/xbuild /user/build/test/fun.sln /t:Clean /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
'/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild clean should have been run on the solution.');
//build
assert(tr.ran('/home/bin/xbuild /user/build/fun.sln /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
'/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild should have been run for building the solution.');
assert(tr.ran('/home/bin/xbuild /user/build/test/fun.sln /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
'/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild should have been run for building the solution.');
assert(tr.invokedToolCount === 4, 'should have run xbuild for solution.');
assert(tr.stderr.length === 0, 'should not have written to stderr');
assert(tr.succeeded, 'task should have succeeded');
done();
});