Skip to content

Commit

Permalink
Merge pull request #20024 from strapi/chore/delete-cli-version-test
Browse files Browse the repository at this point in the history
Refactor cli version test
  • Loading branch information
Christian committed Apr 4, 2024
2 parents 14a2f42 + b017a1a commit ab56a0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"prettier": "3.2.5",
"qs": "6.11.1",
"rimraf": "5.0.5",
"semver": "7.5.4",
"stream-chain": "2.2.5",
"stream-json": "1.8.0",
"supertest": "6.3.3",
Expand Down
8 changes: 6 additions & 2 deletions tests/cli/tests/strapi/version/version.test.cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const coffee = require('coffee');
const semver = require('semver');
const assert = require('assert');

const utils = require('../../../utils');

Expand All @@ -25,10 +27,12 @@ describe('--version', () => {
});

it('should output version with --version', async () => {
await coffee
const { stdout } = await coffee
.spawn('npm', ['run', '-s', 'strapi', '--', '--version'], { cwd: appPath })
.expect('stdout', `${currentVersion}\n`)
.expect('code', 0)
.end();

const version = stdout.trim();
assert.ok(semver.valid(version), `Version ${version} is not a valid semver`);
});
});
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26862,6 +26862,7 @@ __metadata:
prettier: "npm:3.2.5"
qs: "npm:6.11.1"
rimraf: "npm:5.0.5"
semver: "npm:7.5.4"
stream-chain: "npm:2.2.5"
stream-json: "npm:1.8.0"
supertest: "npm:6.3.3"
Expand Down

0 comments on commit ab56a0f

Please sign in to comment.