mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
test: fix cli test to work with named versions
This commit is contained in:
parent
17bcd56eae
commit
788e329d6e
|
@ -62,10 +62,11 @@ describe('showdown cli', function () {
|
||||||
|
|
||||||
describe('-v', function () {
|
describe('-v', function () {
|
||||||
it('should display version', function () {
|
it('should display version', function () {
|
||||||
var proc = spawnCLI(null, ['-V'], {});
|
let proc = spawnCLI(null, ['-V'], {}),
|
||||||
|
verRegex = /^(\d{1,2}\.\d{1,3}\.\d{1,3}(?:-(alpha)|(beta)|(rc-\d{1,2})))?/;
|
||||||
proc.status.should.equal(0);
|
proc.status.should.equal(0);
|
||||||
proc.stdout.should.match(/^\d{1,2}\.\d{1,3}\.\d{1,3}/);
|
proc.stdout.should.match(verRegex);
|
||||||
proc.stdout.should.match(/^(\d{1,2}\.\d{1,3}\.\d{1,3})/).and.capture(0).equals(packageJson.version);
|
proc.stdout.should.match(verRegex).and.capture(0).equals(packageJson.version);
|
||||||
proc.stderr.should.equal('');
|
proc.stderr.should.equal('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user