File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ function isHostTrusted(url: url.UrlWithStringQuery): boolean {
210
210
return TrustedSVGSources . indexOf ( url . host . toLowerCase ( ) ) > - 1 || isGitHubBadge ( url . href ) ;
211
211
}
212
212
213
- class ManifestProcessor extends BaseProcessor {
213
+ export class ManifestProcessor extends BaseProcessor {
214
214
constructor ( manifest : Manifest ) {
215
215
super ( manifest ) ;
216
216
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
WebExtensionProcessor ,
14
14
IAsset ,
15
15
IPackageOptions ,
16
+ ManifestProcessor ,
16
17
} from '../package' ;
17
18
import { Manifest } from '../manifest' ;
18
19
import * as path from 'path' ;
@@ -1684,6 +1685,21 @@ describe('toContentTypes', () => {
1684
1685
} ) ;
1685
1686
} ) ;
1686
1687
1688
+ describe ( 'ManifestProcessor' , ( ) => {
1689
+ it ( 'should ensure that package.json is writable' , async ( ) => {
1690
+ const root = fixture ( 'uuid' ) ;
1691
+ const manifest = JSON . parse ( await readFile ( path . join ( root , 'package.json' ) , 'utf8' ) ) ;
1692
+ const processor = new ManifestProcessor ( manifest ) ;
1693
+ const packageJson = {
1694
+ path : 'extension/package.json' ,
1695
+ localPath : path . join ( root , 'package.json' ) ,
1696
+ } ;
1697
+
1698
+ const outPackageJson = await processor . onFile ( packageJson ) ;
1699
+ assert . ok ( outPackageJson . mode & 0o200 ) ;
1700
+ } ) ;
1701
+ } ) ;
1702
+
1687
1703
describe ( 'MarkdownProcessor' , ( ) => {
1688
1704
it ( 'should throw when no baseContentUrl is provided' , async ( ) => {
1689
1705
const manifest = {
You can’t perform that action at this time.
0 commit comments