Skip to content

Commit 7205b28

Browse files
committed
Bump deps, switch to Yarn
1 parent 51ce106 commit 7205b28

22 files changed

+7902
-14716
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/node:10.13
5+
- image: circleci/node:12.18
66

77
steps:
88
- checkout
@@ -11,11 +11,11 @@ jobs:
1111
keys:
1212
- deps-{{ checksum "package.json" }}
1313

14-
- run: npm install
14+
- run: yarn
1515

1616
- save_cache:
1717
paths:
1818
- node_modules
1919
key: deps-{{ checksum "package.json" }}
2020

21-
- run: npm test
21+
- run: yarn test
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 1`] = `"<base href=\\"http://mysite.com/\\" data-rh=\\"true\\">"`;
3+
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 1`] = `"<base href=\\"http://mysite.com/\\" data-rh=\\"true\\">"`;
44
5-
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 2`] = `"<meta charset=\\"utf-8\\" data-rh=\\"true\\">"`;
5+
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 2`] = `"<meta charset=\\"utf-8\\" data-rh=\\"true\\">"`;
66
7-
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 3`] = `"<link href=\\"http://localhost/helmet\\" rel=\\"canonical\\" data-rh=\\"true\\">"`;
7+
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 3`] = `"<link href=\\"http://localhost/helmet\\" rel=\\"canonical\\" data-rh=\\"true\\">"`;
88
9-
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 4`] = `"<script src=\\"http://localhost/test.js\\" type=\\"text/javascript\\" data-rh=\\"true\\"></script>"`;
9+
exports[`onChangeClientState API when handling client state change, calls the function with new state, addedTags and removedTags 4`] = `"<script src=\\"http://localhost/test.js\\" type=\\"text/javascript\\" data-rh=\\"true\\"></script>"`;
1010
11-
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 1`] = `"<base href=\\"http://mysite.com/\\" data-rh=\\"true\\">"`;
11+
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 1`] = `"<base href=\\"http://mysite.com/\\" data-rh=\\"true\\">"`;
1212
13-
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 2`] = `"<meta charset=\\"utf-8\\" data-rh=\\"true\\">"`;
13+
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 2`] = `"<meta charset=\\"utf-8\\" data-rh=\\"true\\">"`;
1414
15-
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 3`] = `"<link href=\\"http://localhost/helmet\\" rel=\\"canonical\\" data-rh=\\"true\\">"`;
15+
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 3`] = `"<link href=\\"http://localhost/helmet\\" rel=\\"canonical\\" data-rh=\\"true\\">"`;
1616
17-
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 4`] = `"<script src=\\"http://localhost/test.js\\" type=\\"text/javascript\\" data-rh=\\"true\\"></script>"`;
17+
exports[`onChangeClientState Declarative API when handling client state change, calls the function with new state, addedTags and removedTags 4`] = `"<script src=\\"http://localhost/test.js\\" type=\\"text/javascript\\" data-rh=\\"true\\"></script>"`;

__tests__/api/base.test.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ describe('base tag', () => {
1111
render(<Helmet base={{ href: 'http://mysite.com/' }} />);
1212

1313
const existingTags = document.head.querySelectorAll(`base[${HELMET_ATTRIBUTE}]`);
14+
1415
expect(existingTags).toBeDefined();
1516

1617
const filteredTags = [].slice
1718
.call(existingTags)
1819
.filter(tag => tag.getAttribute('href') === 'http://mysite.com/');
20+
1921
expect(filteredTags).toHaveLength(1);
2022
});
2123

@@ -24,8 +26,9 @@ describe('base tag', () => {
2426
render(<Helmet />);
2527

2628
const existingTags = document.head.querySelectorAll(`base[${HELMET_ATTRIBUTE}]`);
29+
2730
expect(existingTags).toBeDefined();
28-
expect(existingTags.length).toEqual(0);
31+
expect(existingTags).toHaveLength(0);
2932
});
3033

3134
it("tags without 'href' are not accepted", () => {
@@ -48,7 +51,7 @@ describe('base tag', () => {
4851
const firstTag = [].slice.call(existingTags)[0];
4952

5053
expect(existingTags).toBeDefined();
51-
expect(existingTags.length).toEqual(1);
54+
expect(existingTags).toHaveLength(1);
5255

5356
expect(firstTag).toBeInstanceOf(Element);
5457
expect(firstTag.getAttribute).toBeDefined();
@@ -61,6 +64,7 @@ describe('base tag', () => {
6164

6265
const tagNodes = document.head.querySelectorAll(`base[${HELMET_ATTRIBUTE}]`);
6366
const existingTags = [].slice.call(tagNodes);
67+
6468
expect(existingTags).toHaveLength(0);
6569
});
6670
});
@@ -74,11 +78,13 @@ describe('base tag', () => {
7478
);
7579

7680
const existingTags = document.head.querySelectorAll(`base[${HELMET_ATTRIBUTE}]`);
81+
7782
expect(existingTags).toBeDefined();
7883

7984
const filteredTags = [].slice
8085
.call(existingTags)
8186
.filter(tag => tag.getAttribute('href') === 'http://mysite.com/');
87+
8288
expect(filteredTags).toHaveLength(1);
8389
});
8490

@@ -121,7 +127,7 @@ describe('base tag', () => {
121127
const firstTag = [].slice.call(existingTags)[0];
122128

123129
expect(existingTags).toBeDefined();
124-
expect(existingTags.length).toEqual(1);
130+
expect(existingTags).toHaveLength(1);
125131

126132
expect(firstTag).toBeInstanceOf(Element);
127133
expect(firstTag.getAttribute).toBeDefined();
@@ -138,6 +144,7 @@ describe('base tag', () => {
138144

139145
const tagNodes = document.head.querySelectorAll(`base[${HELMET_ATTRIBUTE}]`);
140146
const existingTags = [].slice.call(tagNodes);
147+
141148
expect(existingTags).toHaveLength(0);
142149
});
143150
});

__tests__/api/bodyAttributes.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('body attributes', () => {
2727
};
2828

2929
Object.keys(attributeList).forEach(attribute => {
30-
it(attribute, () => {
30+
it(`${attribute}`, () => {
3131
const attrValue = attributeList[attribute];
3232

3333
const attr = {
@@ -43,6 +43,7 @@ describe('body attributes', () => {
4343
const bodyTag = document.body;
4444

4545
const reactCompatAttr = HTML_TAG_MAP[attribute] || attribute;
46+
4647
expect(bodyTag.getAttribute(reactCompatAttr)).toEqual(attrValue);
4748
expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual(reactCompatAttr);
4849
});

__tests__/api/client.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Helmet.defaultProps.defer = false;
66

77
describe('onChangeClientState', () => {
88
describe('API', () => {
9-
it('when handling client state change, calls the function with new state, addedTags and removedTags ', () => {
9+
it('when handling client state change, calls the function with new state, addedTags and removedTags', () => {
1010
const onChange = jest.fn();
1111
render(
1212
<div>
@@ -31,7 +31,8 @@ describe('onChangeClientState', () => {
3131
</div>
3232
);
3333

34-
expect(onChange).toBeCalled();
34+
expect(onChange).toHaveBeenCalled();
35+
3536
const newState = onChange.mock.calls[0][0];
3637
const addedTags = onChange.mock.calls[0][1];
3738
const removedTags = onChange.mock.calls[0][2];
@@ -95,7 +96,7 @@ describe('onChangeClientState', () => {
9596
});
9697

9798
describe('Declarative API', () => {
98-
it('when handling client state change, calls the function with new state, addedTags and removedTags ', () => {
99+
it('when handling client state change, calls the function with new state, addedTags and removedTags', () => {
99100
const onChange = jest.fn();
100101
render(
101102
<div>
@@ -109,7 +110,8 @@ describe('onChangeClientState', () => {
109110
</div>
110111
);
111112

112-
expect(onChange).toBeCalled();
113+
expect(onChange).toHaveBeenCalled();
114+
113115
const newState = onChange.mock.calls[0][0];
114116
const addedTags = onChange.mock.calls[0][1];
115117
const removedTags = onChange.mock.calls[0][2];

__tests__/api/htmlAttributes.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe('html attributes', () => {
2121
);
2222

2323
const htmlTag = document.documentElement;
24+
2425
expect(htmlTag.getAttribute('class')).toEqual('myClassName');
2526
expect(htmlTag.getAttribute('lang')).toEqual('en');
2627
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('class,lang');
@@ -43,6 +44,7 @@ describe('html attributes', () => {
4344
);
4445

4546
const htmlTag = document.documentElement;
47+
4648
expect(htmlTag.getAttribute('lang')).toEqual('ja');
4749
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang');
4850
});
@@ -57,6 +59,7 @@ describe('html attributes', () => {
5759
);
5860

5961
const htmlTag = document.documentElement;
62+
6063
expect(htmlTag.getAttribute('amp')).toEqual('');
6164
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('amp');
6265
});
@@ -74,6 +77,7 @@ describe('html attributes', () => {
7477
render(<Helmet />);
7578

7679
const htmlTag = document.documentElement;
80+
7781
expect(htmlTag.getAttribute('lang')).toBeNull();
7882
expect(htmlTag.getAttribute('amp')).toBeNull();
7983
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull();
@@ -100,6 +104,7 @@ describe('html attributes', () => {
100104
);
101105

102106
const htmlTag = document.documentElement;
107+
103108
expect(htmlTag.getAttribute('amp')).toBeNull();
104109
expect(htmlTag.getAttribute('lang')).toEqual('ja');
105110
expect(htmlTag.getAttribute('id')).toEqual('html-tag');
@@ -127,6 +132,7 @@ describe('html attributes', () => {
127132
);
128133

129134
const htmlTag = document.documentElement;
135+
130136
expect(htmlTag.getAttribute('amp')).toBeNull();
131137
expect(htmlTag.getAttribute('lang')).toBeNull();
132138
expect(htmlTag.getAttribute('id')).toEqual('html-tag');
@@ -144,6 +150,7 @@ describe('html attributes', () => {
144150
render(<Helmet />);
145151

146152
const htmlTag = document.documentElement;
153+
147154
expect(htmlTag.getAttribute('test')).toEqual('test');
148155
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull();
149156
});
@@ -158,6 +165,7 @@ describe('html attributes', () => {
158165
);
159166

160167
const htmlTag = document.documentElement;
168+
161169
expect(htmlTag.getAttribute('test')).toEqual('helmet-attr');
162170
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('test');
163171
});
@@ -174,6 +182,7 @@ describe('html attributes', () => {
174182
render(<Helmet />);
175183

176184
const htmlTag = document.documentElement;
185+
177186
expect(htmlTag.getAttribute('test')).toBeNull();
178187
expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull();
179188
});

__tests__/api/meta.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ describe('meta tags', () => {
259259

260260
const tagNodes = document.head.querySelectorAll(`meta[${HELMET_ATTRIBUTE}]`);
261261
const existingTags = [].slice.call(tagNodes);
262+
262263
expect(existingTags).toHaveLength(0);
263264
});
264265

@@ -271,10 +272,11 @@ describe('meta tags', () => {
271272

272273
const tagNodes = document.head.querySelectorAll(`meta[${HELMET_ATTRIBUTE}]`);
273274
const existingTags = [].slice.call(tagNodes);
275+
274276
expect(existingTags).toHaveLength(0);
275277

276-
expect(console.error).toBeCalled();
277-
expect(console.warn).toBeCalled();
278+
expect(console.error).toHaveBeenCalled();
279+
expect(console.warn).toHaveBeenCalled();
278280

279281
expect(console.warn.mock.calls[0][0]).toMatchSnapshot();
280282

@@ -484,6 +486,7 @@ describe('meta tags', () => {
484486

485487
const tagNodes = document.head.querySelectorAll(`meta[${HELMET_ATTRIBUTE}]`);
486488
const existingTags = [].slice.call(tagNodes);
489+
487490
expect(existingTags).toHaveLength(0);
488491
});
489492
});

__tests__/api/noscript.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe('noscript tags', () => {
6060

6161
const tagNodes = document.head.querySelectorAll(`noscript[${HELMET_ATTRIBUTE}]`);
6262
const existingTags = [].slice.call(tagNodes);
63+
6364
expect(existingTags).toHaveLength(0);
6465
});
6566
});
@@ -117,6 +118,7 @@ describe('noscript tags', () => {
117118

118119
const tagNodes = document.head.querySelectorAll(`noscript[${HELMET_ATTRIBUTE}]`);
119120
const existingTags = [].slice.call(tagNodes);
121+
120122
expect(existingTags).toHaveLength(0);
121123
});
122124
});

__tests__/api/script.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ describe('script tags', () => {
157157

158158
const tagNodes = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
159159
const existingTags = [].slice.call(tagNodes);
160+
160161
expect(existingTags).toHaveLength(0);
161162
});
162163

@@ -173,6 +174,7 @@ describe('script tags', () => {
173174

174175
const tagNodes = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
175176
const existingTags = [].slice.call(tagNodes);
177+
176178
expect(existingTags).toHaveLength(0);
177179
});
178180
});
@@ -225,7 +227,7 @@ describe('script tags', () => {
225227
const existingTags = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
226228

227229
expect(existingTags).toBeDefined();
228-
expect(existingTags.length).toEqual(0);
230+
expect(existingTags).toHaveLength(0);
229231
});
230232

231233
it("tags without 'src' are not accepted", () => {
@@ -238,7 +240,7 @@ describe('script tags', () => {
238240
const existingTags = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
239241

240242
expect(existingTags).toBeDefined();
241-
expect(existingTags.length).toEqual(0);
243+
expect(existingTags).toHaveLength(0);
242244
});
243245

244246
it('sets script tags based on deepest nested component', () => {
@@ -294,6 +296,7 @@ describe('script tags', () => {
294296

295297
const tagNodes = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
296298
const existingTags = [].slice.call(tagNodes);
299+
297300
expect(existingTags).toHaveLength(0);
298301
});
299302

@@ -306,6 +309,7 @@ describe('script tags', () => {
306309

307310
const tagNodes = document.head.querySelectorAll(`script[${HELMET_ATTRIBUTE}]`);
308311
const existingTags = [].slice.call(tagNodes);
312+
309313
expect(existingTags).toHaveLength(0);
310314
});
311315
});

__tests__/api/style.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('style tags', () => {
3535
const existingTags = [].slice.call(tagNodes);
3636

3737
const [firstTag, secondTag] = existingTags;
38+
3839
expect(existingTags).toBeDefined();
3940
expect(existingTags).toHaveLength(2);
4041

@@ -96,6 +97,7 @@ describe('style tags', () => {
9697

9798
const tagNodes = document.head.querySelectorAll(`style[${HELMET_ATTRIBUTE}]`);
9899
const existingTags = [].slice.call(tagNodes);
100+
99101
expect(existingTags).toHaveLength(0);
100102
});
101103
});
@@ -124,6 +126,7 @@ describe('Declarative API', () => {
124126
const existingTags = [].slice.call(tagNodes);
125127

126128
const [firstTag, secondTag] = existingTags;
129+
127130
expect(existingTags).toBeDefined();
128131
expect(existingTags).toHaveLength(2);
129132

@@ -180,6 +183,7 @@ describe('Declarative API', () => {
180183

181184
const tagNodes = document.head.querySelectorAll(`style[${HELMET_ATTRIBUTE}]`);
182185
const existingTags = [].slice.call(tagNodes);
186+
183187
expect(existingTags).toHaveLength(0);
184188
});
185189
});

0 commit comments

Comments
 (0)