Skip to content

Update all tests #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 8 additions & 25 deletions tests/unit/index-nodetest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable max-lines-per-function */
const { assert } = require('chai');
const sinon = require('sinon');
const path = require('path');
const Plugin = require('../../index');

function setupSinon() {
Expand Down Expand Up @@ -116,7 +117,7 @@ describe('sentry-cli', function() {
plugin.beforeHook(this.context);
plugin.configure(this.context);

assert.equal(plugin.readConfig('assetsDir'), 'my-dest-dir/assets');
assert.equal(plugin.readConfig('assetsDir'), path.join('my-dest-dir', 'assets'));
});

it('revisionKey', function() {
Expand Down Expand Up @@ -158,10 +159,7 @@ describe('sentry-cli', function() {
plugin.didPrepare();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases new my-project@v1.0.0@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project new my-project@v1.0.0@1234567`);
});

it('sets related commits', function() {
Expand All @@ -173,10 +171,7 @@ describe('sentry-cli', function() {
plugin.didPrepare();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases set-commits --auto my-project@v1.0.0@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project set-commits --auto my-project@v1.0.0@1234567`);
});

it('uploads source maps', function() {
Expand All @@ -188,10 +183,7 @@ describe('sentry-cli', function() {
plugin.didPrepare();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases files my-project@v1.0.0@1234567 upload-sourcemaps --rewrite my-dest-dir/assets');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project files my-project@v1.0.0@1234567 upload-sourcemaps --rewrite ${path.join('my-dest-dir', 'assets')}`);
});

it('saves release', function() {
Expand All @@ -203,10 +195,7 @@ describe('sentry-cli', function() {
plugin.didPrepare();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases finalize my-project@v1.0.0@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project finalize my-project@v1.0.0@1234567`);
});
});

Expand All @@ -220,10 +209,7 @@ describe('sentry-cli', function() {
plugin.didDeploy();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases deploys my-project@v1.0.0@1234567 new -e my-production');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project deploys my-project@v1.0.0@1234567 new -e my-production`);
});
});

Expand All @@ -237,10 +223,7 @@ describe('sentry-cli', function() {
plugin.didFail();

this.sinon.assert.calledWithExactly(stub,
'SENTRY_ORG=my-org ' +
'SENTRY_PROJECT=my-project ' +
'SENTRY_AUTH_TOKEN=my-auth-token ' +
'node_modules/.bin/sentry-cli releases delete my-project@v1.0.0@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project delete my-project@v1.0.0@1234567`);
});
});
});