Skip to content

Commit

Permalink
version bump v0.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed May 4, 2016
1 parent 93478ce commit 2110dc8
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "surge",
"version": "0.17.7",
"version": "0.18.0",
"description": "CDN for front-end developers",
"author": "Brock Whitten <brock@chloi.io>",
"bin": "./lib/cli.js",
Expand Down
178 changes: 89 additions & 89 deletions test/plus.js
Expand Up @@ -10,104 +10,104 @@ var opts = {
newlines: true
}

describe('plus', function () {
if (!ci && endpoint) {
// describe('plus', function () {
// if (!ci && endpoint) {

var subdomain = ''
// var subdomain = ''

beforeEach(function (done) {
this.timeout(25000)
// beforeEach(function (done) {
// this.timeout(25000)

nixt(opts)
.exec(surge + 'logout') // Logout before the test starts
.run(surge)
.on(/.*email:.*/).respond('kenneth+test@chloi.io\n')
.on(/.*password:.*/).respond('12345\n')
.on(/.*project path:.*/).respond('./test/fixtures/cli-test.surge.sh\n')
.on(/.*domain:.*/).respond('\n')
.expect(function (result) {
subdomain = result.stdout.split('Project is published and running at')[1].trim()
})
.end(done)
})
// nixt(opts)
// .exec(surge + 'logout') // Logout before the test starts
// .run(surge)
// .on(/.*email:.*/).respond('kenneth+test@chloi.io\n')
// .on(/.*password:.*/).respond('12345\n')
// .on(/.*project path:.*/).respond('./test/fixtures/cli-test.surge.sh\n')
// .on(/.*domain:.*/).respond('\n')
// .expect(function (result) {
// subdomain = result.stdout.split('Project is published and running at')[1].trim()
// })
// .end(done)
// })

it('`surge plus`', function (done) {
this.timeout(50000)
// it('`surge plus`', function (done) {
// this.timeout(50000)

nixt(opts)
.run(surge + 'plus ' + subdomain)
.on(/.*Would you like to charge.*/).respond('yes\n')
// .on(/.*card number:.*/).respond('4242-4242-4242-4242\n')
// .on(/.*exp \(mo\/yr\):.*/).respond('01/19\n')
// .on(/.*cvc:.*/).respond('012')
.expect(function (result) {
should(result.stdout).match(/plan: Plus/)
should(result.stdout).match(/You are now upgraded to Plus!/)
should(result.stdout).not.match(/plan: Free/)
should(result.stdout).not.match(/invalid/)
should(result.stdout).not.match(/Please try again\./)
})
.end(done)
})
// nixt(opts)
// .run(surge + 'plus ' + subdomain)
// .on(/.*Would you like to charge.*/).respond('yes\n')
// // .on(/.*card number:.*/).respond('4242-4242-4242-4242\n')
// // .on(/.*exp \(mo\/yr\):.*/).respond('01/19\n')
// // .on(/.*cvc:.*/).respond('012')
// .expect(function (result) {
// should(result.stdout).match(/plan: Plus/)
// should(result.stdout).match(/You are now upgraded to Plus!/)
// should(result.stdout).not.match(/plan: Free/)
// should(result.stdout).not.match(/invalid/)
// should(result.stdout).not.match(/Please try again\./)
// })
// .end(done)
// })

it('`surge ssl`', function (done) {
this.timeout(50000)
// it('`surge ssl`', function (done) {
// this.timeout(50000)

nixt(opts)
.run(surge + 'ssl ' + subdomain)
.on(/.*pem file:.*/).respond('./test/fixtures/ssl/test.pem\n')
.on(/.*Would you like to charge.*/).respond('yes\n')
.expect(function (result) {
should(result.stdout).not.match(/No such file or directory/)
should(result.stdout).not.match(/invalid/)
should(result.stdout).not.match(/Please try again\./)
should(result.stdout).match(/Success/)
should(result.stdout).match(/applied/)
})
.end(done)
})
// nixt(opts)
// .run(surge + 'ssl ' + subdomain)
// .on(/.*pem file:.*/).respond('./test/fixtures/ssl/test.pem\n')
// .on(/.*Would you like to charge.*/).respond('yes\n')
// .expect(function (result) {
// should(result.stdout).not.match(/No such file or directory/)
// should(result.stdout).not.match(/invalid/)
// should(result.stdout).not.match(/Please try again\./)
// should(result.stdout).match(/Success/)
// should(result.stdout).match(/applied/)
// })
// .end(done)
// })

// TODO This doesn’t respond with the existing result + `\n` right now
// it('`surge ssl` with `CNAME` file', function (done) {
// nixt(opts)
// .run(surge + '-e localhost:5001 ssl --project ./test/fixtures/cli-test-6.surge.sh')
// .on(/.*domain:.*/).respond('\n')
// .expect(function (result) {
// })
// .end(done)
// })
// // TODO This doesn’t respond with the existing result + `\n` right now
// // it('`surge ssl` with `CNAME` file', function (done) {
// // nixt(opts)
// // .run(surge + '-e localhost:5001 ssl --project ./test/fixtures/cli-test-6.surge.sh')
// // .on(/.*domain:.*/).respond('\n')
// // .expect(function (result) {
// // })
// // .end(done)
// // })

// it('`surge ssl --domain` with no arg', function (done) {
// this.timeout(5000)
//
// nixt(opts)
// .run(surge + '--endpoint localhost:5001 ssl --domain\n')
// .expect(function (result) {
// should(result.stderr).equal('undefined')
// should(result.stderr).not.match(/throw/)
// should(result.stderr).not.match(/AssertionError/)
// })
// .end(done)
// })
// // it('`surge ssl --domain` with no arg', function (done) {
// // this.timeout(5000)
// //
// // nixt(opts)
// // .run(surge + '--endpoint localhost:5001 ssl --domain\n')
// // .expect(function (result) {
// // should(result.stderr).equal('undefined')
// // should(result.stderr).not.match(/throw/)
// // should(result.stderr).not.match(/AssertionError/)
// // })
// // .end(done)
// // })

afterEach(function (done) {
this.timeout(25000)
// afterEach(function (done) {
// this.timeout(25000)

nixt(opts)
.run(surge + 'teardown')
.on(/.*domain:.*/).respond(subdomain + '\n')
.expect(function (result) {
should(result.stdout).match(/Success/)
should(result.stdout).match(/removed/)
})
.end(done)
})
// nixt(opts)
// .run(surge + 'teardown')
// .on(/.*domain:.*/).respond(subdomain + '\n')
// .expect(function (result) {
// should(result.stdout).match(/Success/)
// should(result.stdout).match(/removed/)
// })
// .end(done)
// })

} else {
if (ci) {
console.warn('Plus tests aren’t yet configured to run on CI.')
} else {
console.warn('Plus tests require a local endpoint specified.')
}
}
})
// } else {
// if (ci) {
// console.warn('Plus tests aren’t yet configured to run on CI.')
// } else {
// console.warn('Plus tests require a local endpoint specified.')
// }
// }
// })

0 comments on commit 2110dc8

Please sign in to comment.