-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from sinankeskin/master
Update all tests
- Loading branch information
Showing
1 changed file
with
8 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
|
@@ -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() { | ||
|
@@ -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() { | ||
|
@@ -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() { | ||
|
@@ -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() { | ||
|
@@ -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`); | ||
}); | ||
}); | ||
|
||
|
@@ -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`); | ||
}); | ||
}); | ||
|
||
|
@@ -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`); | ||
}); | ||
}); | ||
}); |