@penskemediacorp/larva 1.25.0 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/__tests__/fixtures/larva.config.js +9 -16
  2. package/__tests__/fixtures/src/patterns/components/c-nav-link/c-nav-link.featured.aia.js +2 -2
  3. package/__tests__/fixtures/src/patterns/components/c-nav-link/c-nav-link.featured.js +2 -2
  4. package/__tests__/fixtures/src/patterns/components/c-nav-link/c-nav-link.js +1 -1
  5. package/__tests__/fixtures/src/patterns/components/c-nav-link/c-nav-link.prototype.js +2 -2
  6. package/__tests__/fixtures/src/patterns/components/c-tagline/c-tagline.prototype.js +2 -2
  7. package/__tests__/fixtures/src/patterns/modules/_also-ignored/_also-ignored.prototype.js +2 -2
  8. package/__tests__/fixtures/src/patterns/modules/test-module/test-module.featured.js +2 -2
  9. package/__tests__/fixtures/src/patterns/modules/test-module/test-module.prototype.js +2 -2
  10. package/__tests__/fixtures/src/patterns/one-offs/newswire/newswire.prototype.js +2 -2
  11. package/__tests__/lib/generateStatic.test.js +120 -86
  12. package/__tests__/lib/utils/clonePatternData.test.js +17 -10
  13. package/__tests__/lib/utils/getAllPatternsObj.test.js +14 -29
  14. package/__tests__/lib/utils/getAppConfiguration.test.js +5 -5
  15. package/__tests__/lib/utils/getModuleNamesFromDirectory.test.js +29 -10
  16. package/__tests__/lib/utils/getPatternData.test.js +36 -23
  17. package/__tests__/lib/utils/getPatternPathsToLoad.test.js +5 -5
  18. package/__tests__/lib/utils/getPatternRoutes.test.js +4 -6
  19. package/__tests__/lib/utils/getPatternType.test.js +4 -4
  20. package/__tests__/lib/utils/getPatternVariants.test.js +7 -12
  21. package/__tests__/lib/utils/getPatternsIndexPath.test.js +9 -4
  22. package/__tests__/lib/utils/getSubDirectoryNames.test.js +16 -6
  23. package/__tests__/lib/utils/isCoreTheme.test.js +5 -3
  24. package/__tests__/lib/utils/writeJsonToFile.test.js +8 -10
  25. package/__tests__/lib/writeJson.test.js +39 -21
  26. package/bin/larva.js +6 -6
  27. package/build/css/larva-important.css +1 -1
  28. package/build/css/larva.css +1 -1
  29. package/build/css/larva.inline-important.css +1 -1
  30. package/build/css/larva.inline.css +1 -1
  31. package/build/js/standalone/video-showcase.js +7 -7
  32. package/build/svg/defs/sprite.defs.html +1 -1
  33. package/build/tokens/spy-2022.custom-properties.css +1 -0
  34. package/build/tokens/spy-2022.json +521 -0
  35. package/build/tokens/spy-2022.map.scss +536 -0
  36. package/build/tokens/spy-2022.raw.json +4039 -0
  37. package/index.js +1 -1
  38. package/lib/generateStatic.js +67 -63
  39. package/lib/server.js +139 -117
  40. package/lib/start.js +1 -1
  41. package/lib/utils/clonePatternData.js +1 -1
  42. package/lib/utils/copySyncHelper.js +5 -6
  43. package/lib/utils/getAllPatternsObj.js +14 -9
  44. package/lib/utils/getAppConfiguration.js +17 -15
  45. package/lib/utils/getArgsFromCli.js +2 -2
  46. package/lib/utils/getModuleNamesFromDirectory.js +13 -6
  47. package/lib/utils/getPatternData.js +19 -11
  48. package/lib/utils/getPatternPathsToLoad.js +5 -5
  49. package/lib/utils/getPatternRoutes.js +29 -27
  50. package/lib/utils/getPatternType.js +3 -3
  51. package/lib/utils/getPatternVariants.js +5 -6
  52. package/lib/utils/getPatternsIndexPath.js +3 -3
  53. package/lib/utils/getSubDirectoryNames.js +5 -5
  54. package/lib/utils/isCoreTheme.js +1 -2
  55. package/lib/utils/renderSass.js +17 -14
  56. package/lib/utils/spawnScript.js +4 -9
  57. package/lib/utils/writeJsonToFile.js +2 -2
  58. package/lib/writeJson.js +34 -15
  59. package/package.json +15 -12
  60. package/scripts/build-html.js +21 -14
  61. package/scripts/build-icons.js +38 -26
  62. package/scripts/build-scss.js +1 -1
  63. package/scripts/config/.eslintrc.json +2 -1
  64. package/scripts/config/gulpfile.js +0 -1
  65. package/scripts/config/stylelint.config.js +1 -1
  66. package/scripts/config/webpack.config.js +22 -20
  67. package/scripts/dev-js.js +1 -1
  68. package/scripts/dev-scss.js +2 -7
  69. package/scripts/help.js +9 -7
  70. package/scripts/init.js +4 -2
  71. package/scripts/larva/larva.config.js +1 -1
  72. package/scripts/link-all.js +2 -2
  73. package/scripts/lint-js.js +1 -4
  74. package/scripts/lint-scss.js +5 -7
  75. package/scripts/lint.js +4 -4
  76. package/scripts/prod-js.js +1 -4
  77. package/scripts/prod-scss.js +5 -2
  78. package/scripts/prod.js +16 -22
  79. package/scripts/server.js +1 -3
  80. package/scripts/start.js +3 -3
  81. package/scripts/upgrade.js +10 -14
  82. package/scripts/write-json.js +4 -2
@@ -1,43 +1,36 @@
1
1
  const path = require( 'path' );
2
2
 
3
3
  module.exports = {
4
-
5
4
  webpack: {
6
5
  entry: {
7
6
  common: './common.entry.js',
8
7
  critical: './critical.entry.js',
9
8
  special: './special.entry.js',
10
- great: './great.entry.js'
11
- }
9
+ great: './great.entry.js',
10
+ },
12
11
  },
13
12
 
14
13
  backstop: {
15
14
  testBaseUrl: 'https://pmc:for-the-win@deadline-2019.pmcqa.com',
16
- testPaths: [
17
- '/',
18
- '/blog/'
19
- ],
15
+ testPaths: [ '/', '/blog/' ],
20
16
  testScenario: {
21
- 'delay': 5000,
22
- 'misMatchThreshold': 0.5
17
+ delay: 5000,
18
+ misMatchThreshold: 0.5,
23
19
  },
24
- larvaModules: [ 'footer', 'mega-menu-content', 'social-share' ]
20
+ larvaModules: [ 'footer', 'mega-menu-content', 'social-share' ],
25
21
  },
26
22
 
27
23
  patterns: {
28
24
  projectPatternsDir: path.join( __dirname, './src/patterns' ),
29
25
  larvaPatternsDir: path.resolve( __dirname, '../../../larva-patterns' ),
30
- ignoredModules: [
31
- 'ignore-me'
32
- ]
26
+ ignoredModules: [ 'ignore-me' ],
33
27
  },
34
28
 
35
29
  assets: {
36
- path: __dirname
30
+ path: __dirname,
37
31
  },
38
32
 
39
33
  parser: {
40
34
  isCore: false,
41
35
  },
42
-
43
- };
36
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- modifier_class: 'featured aia'
3
- };
2
+ modifier_class: 'featured aia',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- modifier_class: 'featured'
3
- };
2
+ modifier_class: 'featured',
3
+ };
@@ -1 +1 @@
1
- // this could be JSX or a React component.
1
+ // this could be JSX or a React component.
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- modifier_class: ''
3
- };
2
+ modifier_class: '',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- c_tagline_text: 'overrode the larva pattern'
3
- }
2
+ c_tagline_text: 'overrode the larva pattern',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- also_ignored_classes: 'lrv-u-color-black'
3
- };
2
+ also_ignored_classes: 'lrv-u-color-black',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- test_module_classes: 'lrv-a-glue'
3
- }
2
+ test_module_classes: 'lrv-a-glue',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- test_module_classes: 'lrv-u-flex'
3
- }
2
+ test_module_classes: 'lrv-u-flex',
3
+ };
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- name: "newswire"
3
- };
2
+ name: 'newswire',
3
+ };
@@ -13,113 +13,149 @@ const buildPath = path.join( fixture, './build/html/project' );
13
13
  beforeAll( ( done ) => {
14
14
  app.listen( port, () => {
15
15
  done();
16
- });
17
- });
16
+ } );
17
+ } );
18
18
 
19
19
  describe( 'generateStatic', () => {
20
-
21
20
  beforeEach( ( done ) => {
22
-
23
21
  exec( 'mkdir -p ' + buildPath, ( err ) => {
24
22
  if ( err ) {
25
23
  console.error( err );
26
24
  }
27
25
  done();
28
26
  } );
29
-
30
27
  } );
31
28
 
32
29
  it( 'creates an index.html file for a prototype pattern', ( done ) => {
33
-
34
- const routesArr = [
35
- 'components/c-link'
36
- ];
37
-
38
- generateStatic( routesArr, buildPath, () => {
39
- expect(
40
- fs.existsSync( path.join( buildPath, 'components/c-link/index.html' ) )
41
- ).toBe( true );
42
- done();
43
- }, urlBase );
44
-
30
+ const routesArr = [ 'components/c-link' ];
31
+
32
+ generateStatic(
33
+ routesArr,
34
+ buildPath,
35
+ () => {
36
+ expect(
37
+ fs.existsSync(
38
+ path.join( buildPath, 'components/c-link/index.html' )
39
+ )
40
+ ).toBe( true );
41
+ done();
42
+ },
43
+ urlBase
44
+ );
45
45
  } );
46
46
 
47
47
  it( 'creates an html file for a pattern variant', ( done ) => {
48
- const routesArr = [
49
- 'components/c-button/brand-basic'
50
- ];
51
-
52
- generateStatic( routesArr, buildPath, () => {
53
- expect(
54
- fs.existsSync( path.join( buildPath, 'components/c-button/brand-basic/index.html' ) )
55
- ).toBe( true );
56
- done();
57
- }, urlBase );
58
-
48
+ const routesArr = [ 'components/c-button/brand-basic' ];
49
+
50
+ generateStatic(
51
+ routesArr,
52
+ buildPath,
53
+ () => {
54
+ expect(
55
+ fs.existsSync(
56
+ path.join(
57
+ buildPath,
58
+ 'components/c-button/brand-basic/index.html'
59
+ )
60
+ )
61
+ ).toBe( true );
62
+ done();
63
+ },
64
+ urlBase
65
+ );
59
66
  } );
60
67
 
61
68
  it( 'contains content for the pattern', ( done ) => {
62
- const routesArr = [
63
- 'modules/footer',
64
- ];
65
-
66
- generateStatic( routesArr, buildPath, () => {
67
- expect(
68
- // Hacky way to test that the response actually contains
69
- // the content, not an error.
70
- fs.readFileSync(
71
- path.join( buildPath, routesArr[0] + '/index.html' ),
72
- { encoding: 'utf8' }
73
- ).indexOf( 'footer_classes' )
74
- ).not.toBe( -1 );
75
- done();
76
- }, urlBase );
69
+ const routesArr = [ 'modules/footer' ];
70
+
71
+ generateStatic(
72
+ routesArr,
73
+ buildPath,
74
+ () => {
75
+ expect(
76
+ // Hacky way to test that the response actually contains
77
+ // the content, not an error.
78
+ fs
79
+ .readFileSync(
80
+ path.join(
81
+ buildPath,
82
+ routesArr[ 0 ] + '/index.html'
83
+ ),
84
+ { encoding: 'utf8' }
85
+ )
86
+ .indexOf( 'footer_classes' )
87
+ ).not.toBe( -1 );
88
+ done();
89
+ },
90
+ urlBase
91
+ );
77
92
  } );
78
93
 
79
94
  it( 'copies static assets', ( done ) => {
80
- const routesArr = [
81
- 'components/c-button/brand-basic'
82
- ];
83
-
84
- generateStatic( routesArr, buildPath, () => {
85
-
86
- // This is kinda sloppy and may be annoying to maintain, and there is
87
- // surely a more elegant way to test this functionality than checking
88
- // if the file exists...
89
-
90
- // JS
91
- expect(
92
- fs.existsSync( path.join( buildPath, '../assets/build/js/larva-ui.js' ) )
93
- ).toBe( true );
94
-
95
- // CSS
96
- expect(
97
- fs.existsSync( path.join( buildPath, '../assets/build/css/common.inline.css' ) )
98
- ).toBe( true );
99
-
100
- // Images
101
- expect(
102
- fs.existsSync( path.join( buildPath, '../assets/build/images/test.png' ) )
103
- ).toBe( true );
104
-
105
- // SVG
106
- expect(
107
- fs.existsSync( path.join( buildPath, '../assets/build/svg/defs/sprite.svg' ) )
108
- ).toBe( true );
109
-
110
- // Public dir
111
- expect(
112
- fs.existsSync( path.join( buildPath, '../assets/public/some-library.js' ) )
113
- ).toBe( true );
114
-
115
- done();
116
-
117
- }, urlBase );
118
-
95
+ const routesArr = [ 'components/c-button/brand-basic' ];
96
+
97
+ generateStatic(
98
+ routesArr,
99
+ buildPath,
100
+ () => {
101
+ // This is kinda sloppy and may be annoying to maintain, and there is
102
+ // surely a more elegant way to test this functionality than checking
103
+ // if the file exists...
104
+
105
+ // JS
106
+ expect(
107
+ fs.existsSync(
108
+ path.join( buildPath, '../assets/build/js/larva-ui.js' )
109
+ )
110
+ ).toBe( true );
111
+
112
+ // CSS
113
+ expect(
114
+ fs.existsSync(
115
+ path.join(
116
+ buildPath,
117
+ '../assets/build/css/common.inline.css'
118
+ )
119
+ )
120
+ ).toBe( true );
121
+
122
+ // Images
123
+ expect(
124
+ fs.existsSync(
125
+ path.join(
126
+ buildPath,
127
+ '../assets/build/images/test.png'
128
+ )
129
+ )
130
+ ).toBe( true );
131
+
132
+ // SVG
133
+ expect(
134
+ fs.existsSync(
135
+ path.join(
136
+ buildPath,
137
+ '../assets/build/svg/defs/sprite.svg'
138
+ )
139
+ )
140
+ ).toBe( true );
141
+
142
+ // Public dir
143
+ expect(
144
+ fs.existsSync(
145
+ path.join(
146
+ buildPath,
147
+ '../assets/public/some-library.js'
148
+ )
149
+ )
150
+ ).toBe( true );
151
+
152
+ done();
153
+ },
154
+ urlBase
155
+ );
119
156
  } );
120
157
 
121
158
  afterEach( ( done ) => {
122
-
123
159
  const htmlDir = path.join( buildPath, '../' );
124
160
 
125
161
  exec( 'rm -r ' + htmlDir, ( err ) => {
@@ -128,13 +164,11 @@ describe( 'generateStatic', () => {
128
164
  }
129
165
  done();
130
166
  } );
131
-
132
167
  } );
133
-
134
168
  } );
135
169
 
136
170
  afterAll( async ( done ) => {
137
171
  const server = app.listen();
138
172
  server.close();
139
173
  done();
140
- });
174
+ } );
@@ -4,20 +4,27 @@ const getConfig = require( '../../../lib/utils/getAppConfiguration' );
4
4
  const { projectPatternsDir, larvaPatternsDir } = getConfig( 'patterns' );
5
5
 
6
6
  describe( 'clonePatternData', () => {
7
-
8
7
  it( 'gets object from project patterns dir first', () => {
9
-
10
- const expected = require( path.join( projectPatternsDir, '/components/c-tagline/c-tagline.prototype' ) );
11
- const c_tagline = clonePatternData( 'components/c-tagline/c-tagline.prototype');
8
+ const expected = require( path.join(
9
+ projectPatternsDir,
10
+ '/components/c-tagline/c-tagline.prototype'
11
+ ) );
12
+ const c_tagline = clonePatternData(
13
+ 'components/c-tagline/c-tagline.prototype'
14
+ );
12
15
 
13
16
  expect( c_tagline ).toStrictEqual( expected );
14
- });
17
+ } );
15
18
 
16
19
  it( 'falls back to object from larva patterns dir', () => {
17
- const expected = require( path.join( larvaPatternsDir, '/components/c-button/c-button.prototype' ) );
18
- const c_button = clonePatternData( 'components/c-button/c-button.prototype');
20
+ const expected = require( path.join(
21
+ larvaPatternsDir,
22
+ '/components/c-button/c-button.prototype'
23
+ ) );
24
+ const c_button = clonePatternData(
25
+ 'components/c-button/c-button.prototype'
26
+ );
19
27
 
20
28
  expect( c_button ).toStrictEqual( expected );
21
- });
22
-
23
- });
29
+ } );
30
+ } );
@@ -3,43 +3,28 @@ const getAppConfiguration = require( '../../../lib/utils/getAppConfiguration' );
3
3
  const getAllPatternsObj = require( '../../../lib/utils/getAllPatternsObj' );
4
4
 
5
5
  const expectedPatterns = {
6
- '__tests__' : {},
7
- 'components': {
8
- 'c-nav-link': [
9
- 'featured.aia',
10
- 'featured',
11
- 'prototype'
12
- ],
13
- 'c-tagline': [
14
- 'prototype'
15
- ]
6
+ __tests__: {},
7
+ components: {
8
+ 'c-nav-link': [ 'featured.aia', 'featured', 'prototype' ],
9
+ 'c-tagline': [ 'prototype' ],
16
10
  },
17
- 'modules': {
18
- 'test-module': [
19
- 'featured',
20
- 'prototype'
21
- ]
11
+ modules: {
12
+ 'test-module': [ 'featured', 'prototype' ],
22
13
  },
23
- 'objects': {
14
+ objects: {
24
15
  'o-crap': [],
25
- 'o-nav': []
16
+ 'o-nav': [],
26
17
  },
27
18
  'one-offs': {
28
- 'newswire': [
29
- 'prototype'
30
- ]
31
- }
32
- }
19
+ newswire: [ 'prototype' ],
20
+ },
21
+ };
33
22
  const config = getAppConfiguration( 'patterns' );
34
23
 
35
24
  describe( 'getAllPatternsObj', () => {
36
-
37
25
  it( 'returns an object containing all patterns and variants', () => {
38
-
39
- expect(
40
- getAllPatternsObj( config.projectPatternsDir )
41
- ).toEqual(
26
+ expect( getAllPatternsObj( config.projectPatternsDir ) ).toEqual(
42
27
  expectedPatterns
43
28
  );
44
- });
45
- });
29
+ } );
30
+ } );
@@ -5,9 +5,9 @@ const getAppConfiguration = require( '../../../lib/utils/getAppConfiguration' );
5
5
  const expectedLarvaConfig = require( fixture + '/larva.config.js' );
6
6
 
7
7
  describe( 'getAppConfiguration', () => {
8
-
9
8
  it( 'Get Larva Configuration', () => {
10
- expect(getAppConfiguration( 'backstop' )).toStrictEqual( expectedLarvaConfig.backstop );
11
- });
12
-
13
- });
9
+ expect( getAppConfiguration( 'backstop' ) ).toStrictEqual(
10
+ expectedLarvaConfig.backstop
11
+ );
12
+ } );
13
+ } );
@@ -5,19 +5,38 @@ const config = getAppConfiguration( 'patterns' );
5
5
 
6
6
  describe( 'getModuleNamesFromDirectory', () => {
7
7
  it( 'gets an array of modules', () => {
8
- expect( getModuleNamesFromDirectory( config.projectPatternsDir, config.ignoredModules ) ).toEqual( expect.arrayContaining( [ 'test-module' ] ) );
9
- });
8
+ expect(
9
+ getModuleNamesFromDirectory(
10
+ config.projectPatternsDir,
11
+ config.ignoredModules
12
+ )
13
+ ).toEqual( expect.arrayContaining( [ 'test-module' ] ) );
14
+ } );
10
15
 
11
16
  it( 'ignored modules with underscores', () => {
12
- expect( getModuleNamesFromDirectory( config.projectPatternsDir, config.ignoredModules ) ).toEqual( expect.not.arrayContaining( [ '_also-ignored' ] ) );
13
- });
17
+ expect(
18
+ getModuleNamesFromDirectory(
19
+ config.projectPatternsDir,
20
+ config.ignoredModules
21
+ )
22
+ ).toEqual( expect.not.arrayContaining( [ '_also-ignored' ] ) );
23
+ } );
14
24
 
15
25
  it( 'ignores modules listed in larva.config.ignoredModules', () => {
16
- expect( getModuleNamesFromDirectory( config.projectPatternsDir, config.ignoredModules ) ).toEqual( expect.not.arrayContaining( [ 'ignore-me' ] ) );
17
- });
26
+ expect(
27
+ getModuleNamesFromDirectory(
28
+ config.projectPatternsDir,
29
+ config.ignoredModules
30
+ )
31
+ ).toEqual( expect.not.arrayContaining( [ 'ignore-me' ] ) );
32
+ } );
18
33
 
19
34
  it( 'gets module names from larva', () => {
20
- expect( getModuleNamesFromDirectory( config.larvaPatternsDir, config.ignoredModules ) ).toEqual( expect.arrayContaining( [ 'pmc-footer' ] ) );
21
- });
22
-
23
- });
35
+ expect(
36
+ getModuleNamesFromDirectory(
37
+ config.larvaPatternsDir,
38
+ config.ignoredModules
39
+ )
40
+ ).toEqual( expect.arrayContaining( [ 'pmc-footer' ] ) );
41
+ } );
42
+ } );
@@ -4,52 +4,65 @@ const fs = require( 'fs' );
4
4
  const fixture = path.join( __dirname, '../../fixtures' );
5
5
 
6
6
  const getPatternData = require( '../../../lib/utils/getPatternData' );
7
- const appConfiguration = require( '../../../lib/utils/getAppConfiguration' )('patterns');
7
+ const appConfiguration = require( '../../../lib/utils/getAppConfiguration' )(
8
+ 'patterns'
9
+ );
8
10
 
9
- const expectedSchema = require( fixture + '/src/patterns/components/c-nav-link/c-nav-link.prototype.js' );
10
- const expectedVariantSchema = require( fixture + '/src/patterns/components/c-nav-link/c-nav-link.featured.js' );
11
- const expectedSchemaFromJson = require( fixture + '/src/patterns/objects/o-crap/o-crap.json' );
11
+ const expectedSchema = require( fixture +
12
+ '/src/patterns/components/c-nav-link/c-nav-link.prototype.js' );
13
+ const expectedVariantSchema = require( fixture +
14
+ '/src/patterns/components/c-nav-link/c-nav-link.featured.js' );
15
+ const expectedSchemaFromJson = require( fixture +
16
+ '/src/patterns/objects/o-crap/o-crap.json' );
12
17
  const expectedPath = fixture + '/src/patterns/objects/o-nav/o-nav.json';
13
- const expectedOneOffSchema = require( fixture + '/src/patterns/one-offs/newswire/newswire.prototype.js' );
18
+ const expectedOneOffSchema = require( fixture +
19
+ '/src/patterns/one-offs/newswire/newswire.prototype.js' );
14
20
 
15
- let compStub = {
21
+ const compStub = {
16
22
  name: 'c-nav-link',
17
23
  type: 'components',
18
- variant: 'prototype'
24
+ variant: 'prototype',
19
25
  };
20
26
 
21
27
  const objStub = {
22
28
  name: 'o-crap',
23
29
  type: 'objects',
24
- variant: 'prototype'
30
+ variant: 'prototype',
25
31
  };
26
32
 
27
33
  const oneOffStub = {
28
34
  name: 'newswire',
29
35
  type: 'one-offs',
30
- variant: 'prototype'
36
+ variant: 'prototype',
31
37
  };
32
38
 
33
39
  describe( 'getPatternData', () => {
34
-
35
40
  it( 'first returns the pattern object if the schema is found', () => {
36
- assert.equal( getPatternData( fixture + '/src/patterns', compStub ), expectedSchema );
37
- });
41
+ assert.equal(
42
+ getPatternData( fixture + '/src/patterns', compStub ),
43
+ expectedSchema
44
+ );
45
+ } );
38
46
 
39
47
  it( 'returns the pattern object for one-offs', () => {
40
- assert.equal( getPatternData( fixture + '/src/patterns', oneOffStub ), expectedOneOffSchema );
41
- });
48
+ assert.equal(
49
+ getPatternData( fixture + '/src/patterns', oneOffStub ),
50
+ expectedOneOffSchema
51
+ );
52
+ } );
42
53
 
43
54
  it( 'returns the pattern json object if no prototype is found', () => {
44
- assert.equal( getPatternData( fixture + '/src/patterns', objStub ), expectedSchemaFromJson );
45
- });
55
+ assert.equal(
56
+ getPatternData( fixture + '/src/patterns', objStub ),
57
+ expectedSchemaFromJson
58
+ );
59
+ } );
46
60
 
47
61
  it( 'gets a variant specified in params', () => {
48
62
  compStub.variant = 'featured';
49
- assert.equal( getPatternData( fixture + '/src/patterns', compStub ), expectedVariantSchema );
50
- });
51
-
52
- });
53
-
54
-
55
-
63
+ assert.equal(
64
+ getPatternData( fixture + '/src/patterns', compStub ),
65
+ expectedVariantSchema
66
+ );
67
+ } );
68
+ } );
@@ -2,12 +2,12 @@ const assert = require( 'assert' );
2
2
  const path = require( 'path' );
3
3
  const fixture = path.join( __dirname, '../../fixtures' );
4
4
  const getPatternPathsToLoad = require( '../../../lib/utils/getPatternPathsToLoad' );
5
- const appConfiguration = require( '../../../lib/utils/getAppConfiguration' )('patterns');
5
+ const appConfiguration = require( '../../../lib/utils/getAppConfiguration' )(
6
+ 'patterns'
7
+ );
6
8
 
7
9
  describe( 'getPatternPathsToLoad', () => {
8
-
9
10
  it( 'returns an array of paths loads larvaPath if it is the core theme', () => {
10
11
  assert.equal( getPatternPathsToLoad( appConfiguration ).length, 2 );
11
- });
12
-
13
- });
12
+ } );
13
+ } );
@@ -5,10 +5,10 @@ const getAllPatternsObj = require( '../../../lib/utils/getAllPatternsObj' );
5
5
  const getPatternRoutes = require( '../../../lib/utils/getPatternRoutes' );
6
6
 
7
7
  describe( 'getPatternRoutes', () => {
8
-
9
8
  it( 'outputs an array of routes from a pattern object', () => {
10
-
11
- const patterns = getAllPatternsObj( path.join( fixture, 'src/patterns' ) );
9
+ const patterns = getAllPatternsObj(
10
+ path.join( fixture, 'src/patterns' )
11
+ );
12
12
 
13
13
  const expected = [
14
14
  'components/c-nav-link/featured.aia',
@@ -19,11 +19,9 @@ describe( 'getPatternRoutes', () => {
19
19
  'modules/test-module',
20
20
  'objects/o-crap',
21
21
  'objects/o-nav',
22
- 'one-offs/newswire'
22
+ 'one-offs/newswire',
23
23
  ];
24
24
 
25
25
  expect( getPatternRoutes( patterns ) ).toStrictEqual( expected );
26
-
27
26
  } );
28
-
29
27
  } );