Skip to content

Commit

Permalink
Merge pull request #212 from Financial-Times/feature/ignore-sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverturner committed Mar 8, 2023
2 parents b7d668d + 48ebcc4 commit c070599
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
12 changes: 12 additions & 0 deletions secret-squirrel.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
files: {
allow: [
'test/fixtures/config/sourcemap.js.map'
],
allowOverrides: []
},
strings: {
deny: [],
denyOverrides: []
}
};
6 changes: 0 additions & 6 deletions secrets.js

This file was deleted.

4 changes: 4 additions & 0 deletions src/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function startup(configPath, additionalChecks){
return;
}

if(configFile.endsWith('.map')){
return;
}

const name = configFile.replace('.js', '');
const config = require(path.resolve(configDir, configFile));
const healthchecks = new HealthChecks(config, checks);
Expand Down
20 changes: 20 additions & 0 deletions test/fixtures/config/sourcemap.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/startup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Startup', function(){

it('Should read in the config dir and create new healthcheck objects', function(){
const result = startup(path.resolve(__dirname, 'fixtures/config/'));
expect(result.get('sourcemap')).not.to.exist;
expect(result.get('paywall')).to.exist;
expect(result.get('paywall')).to.be.an.instanceOf(HealthChecks);
});
Expand Down

0 comments on commit c070599

Please sign in to comment.