File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import defaultAddonSigner from 'sign-addon';
5
5
6
6
import defaultBuilder from './build' ;
7
7
import { withTempDir } from '../util/temp-dir' ;
8
- import { isErrorWithCode , UsageError } from '../errors' ;
8
+ import { isErrorWithCode , UsageError , WebExtError } from '../errors' ;
9
9
import getValidatedManifest , { getManifestId } from '../util/manifest' ;
10
10
import { prepareArtifactsDir } from '../util/artifacts' ;
11
11
import { createLogger } from '../util/logger' ;
@@ -120,6 +120,8 @@ export default function sign(
120
120
log . info ( 'SUCCESS' ) ;
121
121
} else {
122
122
log . info ( 'FAIL' ) ;
123
+ throw new WebExtError (
124
+ 'The WebExtension could not be signed' ) ;
123
125
}
124
126
125
127
return signingResult ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import {assert} from 'chai';
7
7
import sinon from 'sinon' ;
8
8
import promisify from 'es6-promisify' ;
9
9
10
- import { onlyInstancesOf , UsageError } from '../../../src/errors' ;
10
+ import { onlyInstancesOf , UsageError , WebExtError } from '../../../src/errors' ;
11
11
import { getManifestId } from '../../../src/util/manifest' ;
12
12
import { withTempDir } from '../../../src/util/temp-dir' ;
13
13
import { basicManifest , manifestWithoutApps } from '../test-util/test.manifest' ;
@@ -248,8 +248,11 @@ describe('sign', () => {
248
248
success : false ,
249
249
} ) ,
250
250
} )
251
- . then ( ( result ) => {
252
- assert . equal ( result . success , false ) ;
251
+ . then ( makeSureItFails ( ) )
252
+ . catch ( ( error ) => {
253
+ assert . instanceOf ( error , WebExtError ) ;
254
+ assert . match ( error . message ,
255
+ / T h e W e b E x t e n s i o n c o u l d n o t b e s i g n e d / ) ;
253
256
} ) ;
254
257
}
255
258
) ) ;
You can’t perform that action at this time.
0 commit comments