Skip to content

Commit

Permalink
Merge pull request #3 from sinankeskin/master
Browse files Browse the repository at this point in the history
Update all tests
  • Loading branch information
Exelord authored May 28, 2020
2 parents ea7d155 + 3693a8a commit 5a900e5
Showing 1 changed file with 8 additions and 25 deletions.
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 [email protected]@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project new [email protected]@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 [email protected]@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project set-commits --auto [email protected]@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 [email protected]@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 [email protected]@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 [email protected]@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project finalize [email protected]@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 [email protected]@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 [email protected]@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 [email protected]@1234567');
`${path.join('node_modules', '.bin', 'sentry-cli')} --auth-token my-auth-token releases --org my-org --project my-project delete [email protected]@1234567`);
});
});
});

0 comments on commit 5a900e5

Please sign in to comment.