Skip to content

Commit ed4a3ce

Browse files
committedJan 2, 2020
Update snapshots to work on both windows/unix
1 parent 3411d5f commit ed4a3ce

File tree

24 files changed

+52
-52
lines changed

24 files changed

+52
-52
lines changed
 

‎test/fixtures/case1/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ CalendarDay.__docgenInfo = {
468468
};
469469
470470
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
471-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case1/input.js\\"] = {
471+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
472472
name: \\"CalendarDay\\",
473473
docgenInfo: CalendarDay.__docgenInfo,
474-
path: \\"test/fixtures/case1/input.js\\"
474+
path: \\"relativePath(input.js)\\"
475475
};
476476
}"
477477
`;

‎test/fixtures/case2/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ var _default = ErrorBox;
7777
exports[\\"default\\"] = _default;
7878
7979
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
80-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case2/input.js\\"] = {
80+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
8181
name: \\"ErrorBox\\",
8282
docgenInfo: ErrorBox.__docgenInfo,
83-
path: \\"test/fixtures/case2/input.js\\"
83+
path: \\"relativePath(input.js)\\"
8484
};
8585
}"
8686
`;

‎test/fixtures/case3/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function abc() {
7272
}
7373
7474
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
75-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case3/input.js\\"] = {
75+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
7676
name: \\"Button\\",
7777
docgenInfo: Button.__docgenInfo,
78-
path: \\"test/fixtures/case3/input.js\\"
78+
path: \\"relativePath(input.js)\\"
7979
};
8080
}"
8181
`;

‎test/fixtures/case4/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function abc() {
7272
}
7373
7474
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
75-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case4/input.js\\"] = {
75+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
7676
name: \\"Button\\",
7777
docgenInfo: Button.__docgenInfo,
78-
path: \\"test/fixtures/case4/input.js\\"
78+
path: \\"relativePath(input.js)\\"
7979
};
8080
}"
8181
`;

‎test/fixtures/case5/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ var _default = First;
4646
exports[\\"default\\"] = _default;
4747
4848
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
49-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case5/input.js\\"] = {
49+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
5050
name: \\"First\\",
5151
docgenInfo: First.__docgenInfo,
52-
path: \\"test/fixtures/case5/input.js\\"
52+
path: \\"relativePath(input.js)\\"
5353
};
5454
}"
5555
`;

‎test/fixtures/case7/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ First.__docgenInfo = {
4545
};
4646
4747
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
48-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case7/input.js\\"] = {
48+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
4949
name: \\"First\\",
5050
docgenInfo: First.__docgenInfo,
51-
path: \\"test/fixtures/case7/input.js\\"
51+
path: \\"relativePath(input.js)\\"
5252
};
5353
}"
5454
`;

‎test/fixtures/case8/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ Wrapper.__docgenInfo = {
8484
};
8585
8686
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
87-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/case8/input.js\\"] = {
87+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
8888
name: \\"Wrapper\\",
8989
docgenInfo: Wrapper.__docgenInfo,
90-
path: \\"test/fixtures/case8/input.js\\"
90+
path: \\"relativePath(input.js)\\"
9191
};
9292
}"
9393
`;

‎test/fixtures/createReactClass/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ ComponentWrapper.__docgenInfo = {
5555
};
5656
5757
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
58-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/createReactClass/input.js\\"] = {
58+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
5959
name: \\"ComponentWrapper\\",
6060
docgenInfo: ComponentWrapper.__docgenInfo,
61-
path: \\"test/fixtures/createReactClass/input.js\\"
61+
path: \\"relativePath(input.js)\\"
6262
};
6363
}"
6464
`;

‎test/fixtures/differentName/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ OriginalName.__docgenInfo = {
106106
};
107107
108108
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
109-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/differentName/input.js\\"] = {
109+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
110110
name: \\"OriginalName\\",
111111
docgenInfo: OriginalName.__docgenInfo,
112-
path: \\"test/fixtures/differentName/input.js\\"
112+
path: \\"relativePath(input.js)\\"
113113
};
114114
}"
115115
`;

‎test/fixtures/example-module-exports/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ App.__docgenInfo = {
3939
};
4040
4141
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
42-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/example-module-exports/input.js\\"] = {
42+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
4343
name: \\"App\\",
4444
docgenInfo: App.__docgenInfo,
45-
path: \\"test/fixtures/example-module-exports/input.js\\"
45+
path: \\"relativePath(input.js)\\"
4646
};
4747
}"
4848
`;

‎test/fixtures/example/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ var _default = App;
7878
exports[\\"default\\"] = _default;
7979
8080
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
81-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/example/input.js\\"] = {
81+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
8282
name: \\"App\\",
8383
docgenInfo: App.__docgenInfo,
84-
path: \\"test/fixtures/example/input.js\\"
84+
path: \\"relativePath(input.js)\\"
8585
};
8686
}"
8787
`;

‎test/fixtures/exportedDeclaration/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Button.__docgenInfo = {
6363
};
6464
6565
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
66-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/exportedDeclaration/input.js\\"] = {
66+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
6767
name: \\"Button\\",
6868
docgenInfo: Button.__docgenInfo,
69-
path: \\"test/fixtures/exportedDeclaration/input.js\\"
69+
path: \\"relativePath(input.js)\\"
7070
};
7171
}"
7272
`;

‎test/fixtures/flowType/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ var _default = FlowTypeButton;
112112
exports[\\"default\\"] = _default;
113113
114114
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
115-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/flowType/input.js\\"] = {
115+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
116116
name: \\"FlowTypeButton\\",
117117
docgenInfo: FlowTypeButton.__docgenInfo,
118-
path: \\"test/fixtures/flowType/input.js\\"
118+
path: \\"relativePath(input.js)\\"
119119
};
120120
}"
121121
`;

‎test/fixtures/forwardRef/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ ErrorBox.__docgenInfo = {
7979
};
8080
8181
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
82-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/forwardRef/input.js\\"] = {
82+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
8383
name: \\"ErrorBox\\",
8484
docgenInfo: ErrorBox.__docgenInfo,
85-
path: \\"test/fixtures/forwardRef/input.js\\"
85+
path: \\"relativePath(input.js)\\"
8686
};
8787
}"
8888
`;

‎test/fixtures/functionDeclaration/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ var _default = FuncDeclaration;
4646
exports[\\"default\\"] = _default;
4747
4848
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
49-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/functionDeclaration/input.js\\"] = {
49+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
5050
name: \\"FuncDeclaration\\",
5151
docgenInfo: FuncDeclaration.__docgenInfo,
52-
path: \\"test/fixtures/functionDeclaration/input.js\\"
52+
path: \\"relativePath(input.js)\\"
5353
};
5454
}"
5555
`;

‎test/fixtures/hoc-function/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ var _default = (0, _reactRedux.connect)(_testSelector.mapStateToProps, _testSele
6060
exports[\\"default\\"] = _default;
6161
6262
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
63-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/hoc-function/input.js\\"] = {
63+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
6464
name: \\"TestComponent\\",
6565
docgenInfo: TestComponent.__docgenInfo,
66-
path: \\"test/fixtures/hoc-function/input.js\\"
66+
path: \\"relativePath(input.js)\\"
6767
};
6868
}"
6969
`;

‎test/fixtures/hoc-multiple/output.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,18 @@ CompA.__docgenInfo = {
141141
};
142142
143143
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
144-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/hoc-multiple/input.js\\"] = {
144+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
145145
name: \\"Component\\",
146146
docgenInfo: Component.__docgenInfo,
147-
path: \\"test/fixtures/hoc-multiple/input.js\\"
147+
path: \\"relativePath(input.js)\\"
148148
};
149149
}
150150
151151
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
152-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/hoc-multiple/input.js\\"] = {
152+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
153153
name: \\"CompA\\",
154154
docgenInfo: CompA.__docgenInfo,
155-
path: \\"test/fixtures/hoc-multiple/input.js\\"
155+
path: \\"relativePath(input.js)\\"
156156
};
157157
}"
158158
`;

‎test/fixtures/hoc/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ var _default = withHoc(Component);
9999
exports[\\"default\\"] = _default;
100100
101101
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
102-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/hoc/input.js\\"] = {
102+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
103103
name: \\"Component\\",
104104
docgenInfo: Component.__docgenInfo,
105-
path: \\"test/fixtures/hoc/input.js\\"
105+
path: \\"relativePath(input.js)\\"
106106
};
107107
}"
108108
`;

‎test/fixtures/multiple-exports/output.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,18 @@ ErrorBox2.__docgenInfo = {
120120
};
121121
122122
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
123-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/multiple-exports/input.js\\"] = {
123+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
124124
name: \\"ErrorBox\\",
125125
docgenInfo: ErrorBox.__docgenInfo,
126-
path: \\"test/fixtures/multiple-exports/input.js\\"
126+
path: \\"relativePath(input.js)\\"
127127
};
128128
}
129129
130130
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
131-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/multiple-exports/input.js\\"] = {
131+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
132132
name: \\"ErrorBox2\\",
133133
docgenInfo: ErrorBox2.__docgenInfo,
134-
path: \\"test/fixtures/multiple-exports/input.js\\"
134+
path: \\"relativePath(input.js)\\"
135135
};
136136
}"
137137
`;

‎test/fixtures/multipleExports2/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ var _default = Breadcrumb;
268268
exports[\\"default\\"] = _default;
269269
270270
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
271-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/multipleExports2/input.js\\"] = {
271+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
272272
name: \\"Breadcrumb\\",
273273
docgenInfo: Breadcrumb.__docgenInfo,
274-
path: \\"test/fixtures/multipleExports2/input.js\\"
274+
path: \\"relativePath(input.js)\\"
275275
};
276276
}"
277277
`;

‎test/fixtures/reactCreateClass/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ ComponentWrapper.__docgenInfo = {
5252
};
5353
5454
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
55-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/reactCreateClass/input.js\\"] = {
55+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
5656
name: \\"ComponentWrapper\\",
5757
docgenInfo: ComponentWrapper.__docgenInfo,
58-
path: \\"test/fixtures/reactCreateClass/input.js\\"
58+
path: \\"relativePath(input.js)\\"
5959
};
6060
}"
6161
`;

‎test/fixtures/reactCreateElement/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ var _default = Kitten;
6868
exports[\\"default\\"] = _default;
6969
7070
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
71-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/reactCreateElement/input.js\\"] = {
71+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
7272
name: \\"Kitten\\",
7373
docgenInfo: Kitten.__docgenInfo,
74-
path: \\"test/fixtures/reactCreateElement/input.js\\"
74+
path: \\"relativePath(input.js)\\"
7575
};
7676
}"
7777
`;

‎test/fixtures/with-custom-handlers/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ var _default = ErrorBox;
7979
exports[\\"default\\"] = _default;
8080
8181
if (typeof STORYBOOK_REACT_CLASSES !== \\"undefined\\") {
82-
STORYBOOK_REACT_CLASSES[\\"test/fixtures/with-custom-handlers/input.js\\"] = {
82+
STORYBOOK_REACT_CLASSES[\\"relativePath(input.js)\\"] = {
8383
name: \\"ErrorBox\\",
8484
docgenInfo: ErrorBox.__docgenInfo,
85-
path: \\"test/fixtures/with-custom-handlers/input.js\\"
85+
path: \\"relativePath(input.js)\\"
8686
};
8787
}"
8888
`;

‎test/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import plugin from '../src';
66

77
jest.mock('../src/relativePath', () => ({
88
relativePath: filename => {
9-
const { posix } = require('path');
10-
return posix.relative('./', posix.resolve('./', filename));
9+
const { basename } = require('path');
10+
return `relativePath(${basename(filename)})`;
1111
},
1212
}));
1313

0 commit comments

Comments
 (0)
Please sign in to comment.