Skip to content

Commit

Permalink
[fix] Make the sync field optional in projectConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmilajesupaul authored and ljharb committed Mar 11, 2019
1 parent 4a794a2 commit 3ac61b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/projectConfig.js
Expand Up @@ -49,7 +49,9 @@ export default {
type: 'object',
properties: {
hooks: { $ref: '#/definitions/require' },
additionalProperties: false,
},
required: false,
},
rootDir: {
type: 'string',
Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/projectConfig.json
@@ -0,0 +1,8 @@
{
"foo": {
"componentsRoot": "./app/assets/javascripts/foo/team/",
"components": "./**/*.{jsx,tsx}",
"variationsRoot": "./app/assets/javascripts/foo/examples/",
"variations": "./**/*VariationProvider.{jsx,tsx}"
}
}
5 changes: 5 additions & 0 deletions test/helpers/validateProjects.js
@@ -1,4 +1,5 @@
import validateProjects from '../../src/helpers/validateProjects';
import testProjectConfig from '../fixtures/projectConfig.json';

describe('validateProjects', () => {
it('throws when projectNames is not a non-empty array', () => {
Expand All @@ -21,4 +22,8 @@ describe('validateProjects', () => {
message: expect.stringContaining(extraMsg),
});
});

it('should pass on a valid projectConfig', () => {
expect(() => validateProjects(testProjectConfig, ['foo'])).not.toThrowError();
});
});

0 comments on commit 3ac61b4

Please sign in to comment.