Skip to content

Commit b3c2e84

Browse files
committed
Update dependencies
1 parent ca0fb8d commit b3c2e84

File tree

9 files changed

+2034
-2587
lines changed

9 files changed

+2034
-2587
lines changed

lib/__tests__/parse.test.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('no interpolations', () => {
4444

4545
test('two components', () => {
4646
let document = parse(
47-
'let Component = styled.div`color: red;`;\nlet Component = styled.div`border-color: blue`;'
47+
'let Component = styled.div`color: red;`;\nlet Component = styled.div`border-color: blue`;',
4848
);
4949

5050
expect(document.nodes).toHaveLength(2);
@@ -375,7 +375,7 @@ describe('simple interpolations', () => {
375375

376376
test('property value with two interpolations', () => {
377377
let document = parse(
378-
'let Component = styled.div`box-shadow: ${elevation1}, ${elevation2}`;'
378+
'let Component = styled.div`box-shadow: ${elevation1}, ${elevation2}`;',
379379
);
380380

381381
expect(document.nodes).toHaveLength(1);
@@ -399,7 +399,7 @@ describe('simple interpolations', () => {
399399

400400
test('property value with props interpolation', () => {
401401
let document = parse(
402-
'let Component = styled.div`background-image: ${(props) => props.backgroundImage}`;'
402+
'let Component = styled.div`background-image: ${(props) => props.backgroundImage}`;',
403403
);
404404

405405
expect(document.nodes).toHaveLength(1);
@@ -445,7 +445,7 @@ describe('simple interpolations', () => {
445445

446446
test('property value with props interpolation inside url function', () => {
447447
let document = parse(
448-
'let Component = styled.div`background-image: url(${(props) => props.backgroundImage})`;'
448+
'let Component = styled.div`background-image: url(${(props) => props.backgroundImage})`;',
449449
);
450450

451451
expect(document.nodes).toHaveLength(1);
@@ -705,7 +705,7 @@ describe('simple interpolations', () => {
705705

706706
test('comment in selector with interpolation', () => {
707707
let document = parse(
708-
'let Component = styled.div`${Card}:hover, /* hello */ b { color: red; }`;'
708+
'let Component = styled.div`${Card}:hover, /* hello */ b { color: red; }`;',
709709
);
710710

711711
expect(document.nodes).toHaveLength(1);
@@ -781,7 +781,7 @@ describe('simple interpolations', () => {
781781

782782
test('multiple after declaration (no semicolon, space after)', () => {
783783
let document = parse(
784-
'let Component = styled.div`color: red; ${borderWidth} ${hello} `;'
784+
'let Component = styled.div`color: red; ${borderWidth} ${hello} `;',
785785
);
786786

787787
expect(document.nodes).toHaveLength(1);
@@ -924,7 +924,7 @@ describe('simple interpolations', () => {
924924

925925
test('between two declarations (no semicolon)', () => {
926926
let document = parse(
927-
'let Component = styled.div`color: red; ${borderWidth} border-color: blue;`;'
927+
'let Component = styled.div`color: red; ${borderWidth} border-color: blue;`;',
928928
);
929929

930930
expect(document.nodes).toHaveLength(1);
@@ -954,7 +954,7 @@ describe('simple interpolations', () => {
954954

955955
test('between two declarations (with semicolon)', () => {
956956
let document = parse(
957-
'let Component = styled.div`color: red; ${borderWidth}; border-color: blue;`;'
957+
'let Component = styled.div`color: red; ${borderWidth}; border-color: blue;`;',
958958
);
959959

960960
expect(document.nodes).toHaveLength(1);
@@ -1016,7 +1016,7 @@ describe('simple interpolations', () => {
10161016

10171017
test('between three declarations (no semicolon)', () => {
10181018
let document = parse(
1019-
'let Component = styled.div`color: red; ${borderWidth} border-color: blue; ${anotherThing} display: none;`;'
1019+
'let Component = styled.div`color: red; ${borderWidth} border-color: blue; ${anotherThing} display: none;`;',
10201020
);
10211021

10221022
expect(document.nodes).toHaveLength(1);
@@ -1052,7 +1052,7 @@ describe('simple interpolations', () => {
10521052

10531053
test('between two declarations, and also trailing interpolation', () => {
10541054
let document = parse(
1055-
'let Component = styled.div`color: red; ${ borderWidth} border-color: blue; ${anotherThing}`;'
1055+
'let Component = styled.div`color: red; ${ borderWidth} border-color: blue; ${anotherThing}`;',
10561056
);
10571057

10581058
expect(document.nodes).toHaveLength(1);
@@ -1270,7 +1270,7 @@ describe('simple interpolations', () => {
12701270
describe('multiple standalone interpolations', () => {
12711271
test('after declaration (no semicolon, no space after)', () => {
12721272
let document = parse(
1273-
'let Component = styled.div`color: red; ${borderWidth}${borderWidth}`;'
1273+
'let Component = styled.div`color: red; ${borderWidth}${borderWidth}`;',
12741274
);
12751275

12761276
expect(document.nodes).toHaveLength(1);
@@ -1294,7 +1294,7 @@ describe('simple interpolations', () => {
12941294

12951295
test('after declaration (no semicolon, space after)', () => {
12961296
let document = parse(
1297-
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth} `;'
1297+
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth} `;',
12981298
);
12991299

13001300
expect(document.nodes).toHaveLength(1);
@@ -1318,7 +1318,7 @@ describe('simple interpolations', () => {
13181318

13191319
test('after declaration (with semicolon)', () => {
13201320
let document = parse(
1321-
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth};`;'
1321+
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth};`;',
13221322
);
13231323

13241324
expect(document.nodes).toHaveLength(1);
@@ -1342,7 +1342,7 @@ describe('simple interpolations', () => {
13421342

13431343
test('before declaration (no semicolon, no space)', () => {
13441344
let document = parse(
1345-
'let Component = styled.div`${borderWidth} ${background}color: red`;'
1345+
'let Component = styled.div`${borderWidth} ${background}color: red`;',
13461346
);
13471347

13481348
expect(document.nodes).toHaveLength(1);
@@ -1367,7 +1367,7 @@ describe('simple interpolations', () => {
13671367

13681368
test('before declaration (no semicolon, with space)', () => {
13691369
let document = parse(
1370-
'let Component = styled.div`${borderWidth}${background} color: red`;'
1370+
'let Component = styled.div`${borderWidth}${background} color: red`;',
13711371
);
13721372

13731373
expect(document.nodes).toHaveLength(1);
@@ -1392,7 +1392,7 @@ describe('simple interpolations', () => {
13921392

13931393
test('before declaration (no semicolon, with space, three interpolations)', () => {
13941394
let document = parse(
1395-
'let Component = styled.div`${borderWidth}${background}${display} color: red`;'
1395+
'let Component = styled.div`${borderWidth}${background}${display} color: red`;',
13961396
);
13971397

13981398
expect(document.nodes).toHaveLength(1);
@@ -1417,7 +1417,7 @@ describe('simple interpolations', () => {
14171417

14181418
test('before declaration (with space)', () => {
14191419
let document = parse(
1420-
'let Component = styled.div`${borderWidth} ${borderWidth} color: red`;'
1420+
'let Component = styled.div`${borderWidth} ${borderWidth} color: red`;',
14211421
);
14221422

14231423
expect(document.nodes).toHaveLength(1);
@@ -1442,7 +1442,7 @@ describe('simple interpolations', () => {
14421442

14431443
test('before declaration (with semicolon)', () => {
14441444
let document = parse(
1445-
'let Component = styled.div`${borderWidth}${borderWidth};color: red`;'
1445+
'let Component = styled.div`${borderWidth}${borderWidth};color: red`;',
14461446
);
14471447

14481448
expect(document.nodes).toHaveLength(1);
@@ -1467,7 +1467,7 @@ describe('simple interpolations', () => {
14671467

14681468
test('before declaration (with semicolon and space)', () => {
14691469
let document = parse(
1470-
'let Component = styled.div`${borderWidth}${borderWidth}; color: red`;'
1470+
'let Component = styled.div`${borderWidth}${borderWidth}; color: red`;',
14711471
);
14721472

14731473
expect(document.nodes).toHaveLength(1);
@@ -1492,7 +1492,7 @@ describe('simple interpolations', () => {
14921492

14931493
test('between two declarations (no semicolon)', () => {
14941494
let document = parse(
1495-
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth} border-color: blue;`;'
1495+
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth} border-color: blue;`;',
14961496
);
14971497

14981498
expect(document.nodes).toHaveLength(1);
@@ -1522,7 +1522,7 @@ describe('simple interpolations', () => {
15221522

15231523
test('between two declarations (with semicolon)', () => {
15241524
let document = parse(
1525-
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth}; border-color: blue;`;'
1525+
'let Component = styled.div`color: red; ${borderWidth} ${borderWidth}; border-color: blue;`;',
15261526
);
15271527

15281528
expect(document.nodes).toHaveLength(1);
@@ -1552,7 +1552,7 @@ describe('simple interpolations', () => {
15521552

15531553
test('before comment (no semicolon, with space)', () => {
15541554
let document = parse(
1555-
'let Component = styled.div`${borderWidth}${background} /* hello */`;'
1555+
'let Component = styled.div`${borderWidth}${background} /* hello */`;',
15561556
);
15571557

15581558
expect(document.nodes).toHaveLength(1);
@@ -1612,7 +1612,7 @@ describe('simple interpolations', () => {
16121612
describe('selectors', () => {
16131613
test('in selector (whole selector)', () => {
16141614
let document = parse(
1615-
'let Component = styled.div`div{${Component} { color: red; }}`;'
1615+
'let Component = styled.div`div{${Component} { color: red; }}`;',
16161616
);
16171617

16181618
expect(document.nodes).toHaveLength(1);
@@ -1643,7 +1643,7 @@ describe('simple interpolations', () => {
16431643

16441644
test('in selector (first part is interpolation, one selector)', () => {
16451645
let document = parse(
1646-
'let Component = styled.div`div{ ${Component} a { color: red; } }`;'
1646+
'let Component = styled.div`div{ ${Component} a { color: red; } }`;',
16471647
);
16481648

16491649
expect(document.nodes).toHaveLength(1);
@@ -1674,7 +1674,7 @@ describe('simple interpolations', () => {
16741674

16751675
test('interpolation with semicolon before selector', () => {
16761676
let document = parse(
1677-
'let Component = styled.div`div {${Component}; a { color: red; }}`;'
1677+
'let Component = styled.div`div {${Component}; a { color: red; }}`;',
16781678
);
16791679

16801680
expect(document.nodes).toHaveLength(1);
@@ -1708,7 +1708,7 @@ describe('simple interpolations', () => {
17081708
describe('standalone interpolation', () => {
17091709
test('after declaration (no semicolon, space after)', () => {
17101710
let document = parse(
1711-
'let Component = styled.div`div{color: red; ${borderWidth} }`;'
1711+
'let Component = styled.div`div{color: red; ${borderWidth} }`;',
17121712
);
17131713

17141714
expect(document.nodes).toHaveLength(1);
@@ -1744,7 +1744,7 @@ describe('simple interpolations', () => {
17441744

17451745
test('after declaration (with semicolon)', () => {
17461746
let document = parse(
1747-
'let Component = styled.div`div{color: red; ${borderWidth};}`;'
1747+
'let Component = styled.div`div{color: red; ${borderWidth};}`;',
17481748
);
17491749

17501750
expect(document.nodes).toHaveLength(1);
@@ -1781,7 +1781,7 @@ describe('simple interpolations', () => {
17811781
test('throws for non-interpolation word after declaration', () => {
17821782
expect(() => {
17831783
parse(
1784-
'let Component = styled.div`div{color: red; ${borderWidth} notInterpolation}`;'
1784+
'let Component = styled.div`div{color: red; ${borderWidth} notInterpolation}`;',
17851785
);
17861786
}).toThrow(/:1:59: Unknown word/);
17871787
});
@@ -1956,7 +1956,7 @@ describe('interpolations with css helper (one level deep)', () => {
19561956

19571957
test('single at the start and at the end', () => {
19581958
let document = parse(
1959-
'let Component = styled.div`${css`color: red`} color: green;${css`color: blue`}`;'
1959+
'let Component = styled.div`${css`color: red`} color: green;${css`color: blue`}`;',
19601960
);
19611961

19621962
expect(document.nodes).toHaveLength(3);
@@ -2112,7 +2112,7 @@ describe('interpolations with css helper (many levels deep)', () => {
21122112

21132113
test('three levels deep at the end', () => {
21142114
let document = parse(
2115-
'let Component = styled.div`${css`color: red;${css`color: blue;${css`color: green;`}`}`}`;'
2115+
'let Component = styled.div`${css`color: red;${css`color: blue;${css`color: green;`}`}`}`;',
21162116
);
21172117

21182118
expect(document.nodes).toHaveLength(4);
@@ -2178,7 +2178,7 @@ describe('interpolations with css helper (many levels deep)', () => {
21782178

21792179
test('two levels at the beginning', () => {
21802180
let document = parse(
2181-
'let Component = styled.div`${css`${css`color: blue`} color: red;`}`;'
2181+
'let Component = styled.div`${css`${css`color: blue`} color: red;`}`;',
21822182
);
21832183

21842184
expect(document.nodes).toHaveLength(3);
@@ -2254,7 +2254,7 @@ describe('interpolations with props', () => {
22542254

22552255
test('props with css helper (at the end)', () => {
22562256
let document = parse(
2257-
'let Component = styled.div`color: green;${props => css`color: red`}`;'
2257+
'let Component = styled.div`color: green;${props => css`color: red`}`;',
22582258
);
22592259

22602260
expect(document.nodes).toHaveLength(2);
@@ -2317,7 +2317,7 @@ describe('interpolations with props', () => {
23172317

23182318
test('props with css helper (at the beginning)', () => {
23192319
let document = parse(
2320-
'let Component = styled.div`${props => css`color: red`} color: green;`;'
2320+
'let Component = styled.div`${props => css`color: red`} color: green;`;',
23212321
);
23222322

23232323
expect(document.nodes).toHaveLength(2);
@@ -2412,7 +2412,7 @@ test('supports TypeScript', () => {
24122412

24132413
test('component after a component with interpolation', () => {
24142414
let document = parse(
2415-
'const Component = styled.div`\n${css`position: sticky;`}\n`;\nconst Trigger = styled.div``;'
2415+
'const Component = styled.div`\n${css`position: sticky;`}\n`;\nconst Trigger = styled.div``;',
24162416
);
24172417

24182418
expect(document.nodes).toHaveLength(3);

0 commit comments

Comments
 (0)