Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pa11y-ci

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa11y-ci - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

CONTRIBUTING.md

41

bin/pa11y-ci.js

@@ -102,12 +102,17 @@ #!/usr/bin/env node

configPath = resolveConfigPath(configPath);
let config = loadLocalConfigUnmodified(configPath);
if (!config) {
config = loadLocalConfigWithJs(configPath);
let config;
try {
config = loadLocalConfigUnmodified(configPath);
if (!config) {
config = loadLocalConfigWithJs(configPath);
}
if (!config) {
config = loadLocalConfigWithJson(configPath);
}
if (program.config && !config) {
return reject(new Error(`The config file "${configPath}" could not be loaded`));
}
} catch (error) {
return reject(new Error(`There was a problem loading "${configPath}":\n${error.stack}`));
}
if (!config) {
config = loadLocalConfigWithJson(configPath);
}
if (program.config && !config) {
return reject(new Error(`The config file "${configPath}" could not be loaded`));
}
resolve(defaultConfig(config || {}));

@@ -133,3 +138,7 @@ });

return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
} catch (error) {}
} catch (error) {
if (error.code !== 'ENOENT') {
throw error;
}
}
}

@@ -141,3 +150,7 @@

return require(`${configPath}.js`);
} catch (error) {}
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
}
}

@@ -149,3 +162,7 @@

return require(`${configPath}.json`);
} catch (error) {}
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
}
}

@@ -152,0 +169,0 @@

# Changelog
## 0.4.0 pre-release (2016-12-05)
* Exit with an error if config files have syntax errors
## 0.3.1 pre-release (2016-11-30)

@@ -5,0 +9,0 @@

{
"name": "pa11y-ci",
"version": "0.3.1",
"version": "0.4.0",
"description": "The Pa11y CI application",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -129,4 +129,6 @@

To contribute to Pa11y CI, clone this repo locally and commit your code on a new branch.
There are many ways to contribute to Pa11y CI, we cover these in the [contributing guide](CONTRIBUTING.md) for this repo.
If you're ready to contribute some code, clone this repo locally and commit your code on a new branch.
Please write unit tests for your code, and check that everything works by running the following before opening a <abbr title="pull request">PR</abbr>:

@@ -133,0 +135,0 @@

@@ -92,1 +92,61 @@ // jscs:disable maximumLineLength

});
describe('pa11y-ci (with a config file that has no extension and syntax errors)', () => {
before(() => {
return global.cliCall([
'--config',
'syntax-errors'
]);
});
it('exits with 1', () => {
assert.strictEqual(global.lastResult.code, 1);
});
it('outputs an error message', () => {
assert.include(global.lastResult.output, 'There was a problem loading');
assert.include(global.lastResult.output, 'syntax-errors');
});
});
describe('pa11y-ci (with a config file that has a "json" extension and syntax errors)', () => {
before(() => {
return global.cliCall([
'--config',
'syntax-errors-json'
]);
});
it('exits with 1', () => {
assert.strictEqual(global.lastResult.code, 1);
});
it('outputs an error message', () => {
assert.include(global.lastResult.output, 'There was a problem loading');
assert.include(global.lastResult.output, 'syntax-errors-json');
});
});
describe('pa11y-ci (with a config file that has a "js" extension and syntax errors)', () => {
before(() => {
return global.cliCall([
'--config',
'syntax-errors-js'
]);
});
it('exits with 1', () => {
assert.strictEqual(global.lastResult.code, 1);
});
it('outputs an error message', () => {
assert.include(global.lastResult.output, 'There was a problem loading');
assert.include(global.lastResult.output, 'syntax-errors-js');
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc