Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Creating cli test list

  • Loading branch information...
commit 222cca85455b69f73455b661a29b6918aac2871a 1 parent 1cc35fb
@andrerod andrerod authored
View
2  lib/cli/linkedrevisioncontrol.js
@@ -207,7 +207,7 @@ GithubClient.prototype.getRepositories = function GithubClient_prototype_getRepo
if (orgs.hasOwnProperty(i)) {
org = orgs[i]; return (function __$GithubClient_prototype_getRepositories__9(__then) {
if (org.login) {
- return __this.client.repos.getFromOrg({ org: org.login }, __cb(_, __frame, 25, 20, function ___(__0, __5) { repos = __5;
+ return __this.client.repos.getFromOrg({ org: org.login, sort: "updated", desc: "desc" }, __cb(_, __frame, 25, 20, function ___(__0, __5) { repos = __5;
orgRepos = orgRepos.concat(repos); __then(); }, true)); } else { __then(); } ; })(__then); } else { __then(); } ; })(function __$GithubClient_prototype_getRepositories__9() { while (__more) { __loop(); }; __more = true; }); } else { __break(); } ; }); do { __loop(); } while (__more); __more = true; })(__then); } else { __then(); } ; })(function __$GithubClient_prototype_getRepositories__9() {
View
2  lib/cli/linkedrevisioncontrol_.js
@@ -207,7 +207,7 @@ GithubClient.prototype.getRepositories = function (username, _) {
if (orgs.hasOwnProperty(i)) {
var org = orgs[i];
if (org.login) {
- repos = this.client.repos.getFromOrg({ org: org.login }, _);
+ repos = this.client.repos.getFromOrg({ org: org.login, sort: 'updated', desc: 'desc' }, _);
orgRepos = orgRepos.concat(repos);
}
View
1  package.json
@@ -47,6 +47,7 @@
},
"scripts": {
"test": "node test/runtests.js testlist.txt",
+ "clitest": "node test/runtests.js clitestlist.txt",
"jshint": "node test/runjshint.js",
"coverage": "node test/runtests.js testlist.txt -coverage > coverage.html",
"extendedtests": "node test/runtests.js extendedtestlist.txt"
View
43 test/cli/commands/cli.site-tests.js
@@ -19,12 +19,47 @@ var capture = require('../util').capture;
suite('cli', function(){
suite('site', function() {
- suite('list', function() {
- test('should list no sites', function(done) {
+ test('site create', function(done) {
+ var siteName = 'cliuttestsite';
+
+ // Setup
+ var originUrl = {
+ stdout: 'myremote\tgit://github.com/andrerod/mynewsite999.git (fetch)\n' +
+ 'myremote\tgit://github.com/andrerod/mynewsite999.git (push)\n',
+ stderr: ''
+ };
+
+ // Create site
+ var cmd = ('node cli.js site create ' + siteName + ' --json --location').split(' ');
+ cmd.push('East US');
+
+ capture(function() {
+ cli.parse(cmd);
+ }, function (result) {
+ result.exitStatus.should.equal(0);
+
+ // List sites
+ cmd = 'node cli.js site list --json'.split(' ');
capture(function() {
- cli.parse('node cli.js site list --json'.split(' '));
+ cli.parse(cmd);
}, function (result) {
- done();
+ var siteList = JSON.parse(result.text);
+
+ var siteExists = siteList.some(function (site) {
+ return site.Name.toLowerCase() === siteName.toLowerCase()
+ });
+
+ siteExists.should.be.ok;
+
+ // Delete created site
+ cmd = ('node cli.js site delete ' + siteName + ' --json').split(' ');
+ capture(function() {
+ cli.parse(cmd);
+ }, function (result) {
+ console.log(result);
+
+ done();
+ });
});
});
});
View
25 test/cli/linkrevisioncontrol-tests.js
@@ -103,30 +103,5 @@ suite('cli', function(){
done();
});
});
-
- test('site create hook', function(done) {
- // Setup
- var originUrl = {
- stdout: 'myremote\tgit://github.com/andrerod/mynewsite999.git (fetch)\n' +
- 'myremote\tgit://github.com/andrerod/mynewsite999.git (push)\n',
- stderr: ''
- };
-
- var cmd = 'node cli.js site create cliuttestsite --github --json --location'.split(' ');
- cmd.push('East US');
- cmd.push('--username');
- cmd.push(process.env['AZURE_GITHUB_USERNAME']);
- cmd.push('--pass');
- cmd.push(process.env['AZURE_GITHUB_PASSWORD']);
-
- capture(function() {
- cli.parse(cmd);
- }, function (result) {
- console.log('terminei');
- console.log(result);
-
- done();
- });
- });
});
});
View
13 test/cli/util.js
@@ -32,17 +32,20 @@ function capture(action, cb) {
process.exit = function(status) {
result.exitStatus = status;
+ process.stdout.write = processStdoutWrite;
+ process.exit = processExit;
+
return cb(result);
};
- console.log('cheguei aqui');
-
try {
action();
} catch(err) {
result.error = err;
- }
- process.stdout.write = processStdoutWrite;
- process.exit = processExit;
+ process.stdout.write = processStdoutWrite;
+ process.exit = processExit;
+
+ cb(result);
+ }
}
View
3  test/clitestlist.txt
@@ -0,0 +1,3 @@
+cli/commands/generate-psm1-utils-test.js
+cli/commands/cli.site-tests.js
+cli/linkrevisioncontrol-tests.js
View
36 test/testlist.txt
@@ -1 +1,35 @@
-cli/linkrevisioncontrol-tests.js
+serviceruntime/roleenvironment-tests.js
+serviceruntime/runtimeversionmanager-tests.js
+serviceruntime/runtimeversionprotocolclient-tests.js
+services/blob/blobservice-tests.js
+services/blob/sharedaccesssignature-tests.js
+services/blob/sharedkey-tests.js
+services/blob/sharedkeylite-tests.js
+services/blob/filters-tests.js
+services/core/connectionstringparser-tests.js
+services/core/serviceclient-tests.js
+services/core/exponentialretrypolicyfilter-tests.js
+services/core/linearretrypolicyfilter-tests.js
+services/core/servicesettings-tests.js
+services/core/servicebussettings-tests.js
+services/core/servicemanagementsettings-tests.js
+services/core/storageservicesettings-tests.js
+services/queue/queueservice-tests.js
+services/table/batchserviceclient-tests.js
+services/table/sharedkeytable-tests.js
+services/table/sharedkeylitetable-tests.js
+services/serviceBus/servicebusservice-tests.js
+services/serviceBus/wrapservice-tests.js
+services/serviceBus/wraptokenmanager-tests.js
+services/table/tablequery-tests.js
+services/table/tableservice-batch-tests.js
+services/table/tableservice-tablequery-tests.js
+services/table/tableservice-tests.js
+util/atomhandler-tests.js
+util/iso8061date-tests.js
+util/util-tests.js
+util/validate-tests.js
+util/certificates/der.decoder-tests.js
+util/certificates/der.decoder.pfx.root-tests.js
+util/certificates/pkcs.filedecoder-tests.js
+azure-tests.js
Please sign in to comment.
Something went wrong with that request. Please try again.