@@ -55,6 +55,136 @@ Array [
55
55
]
56
56
` ;
57
57
58
+ exports [` emit asserts for: output match: defineMessage 1` ] = `
59
+ Object {
60
+ " messages" : Array [
61
+ Object {
62
+ " defaultMessage" : " Hello World!" ,
63
+ " description" : " The default message" ,
64
+ " id" : " foo.bar.baz" ,
65
+ },
66
+ Object {
67
+ " defaultMessage" : " Hello Nurse!" ,
68
+ " description" : " Another message" ,
69
+ " id" : " foo.bar.biff" ,
70
+ },
71
+ Object {
72
+ " defaultMessage" : " {count, plural, =0 {😭} one {# kitten} other {# kittens}}" ,
73
+ " description" : " Counts kittens" ,
74
+ " id" : " app.home.kittens" ,
75
+ },
76
+ Object {
77
+ " defaultMessage" : " Some whitespace " ,
78
+ " description" : " Whitespace" ,
79
+ " id" : " trailing.ws" ,
80
+ },
81
+ Object {
82
+ " defaultMessage" : " A quoted value ''{value}'" ,
83
+ " description" : " Escaped apostrophe" ,
84
+ " id" : " escaped.apostrophe" ,
85
+ },
86
+ ],
87
+ " meta" : Object {
88
+ " project" : " amazing" ,
89
+ },
90
+ }
91
+ ` ;
92
+
93
+ exports [` emit asserts for: output match: defineMessage 2` ] = `
94
+ "\\ "use strict\\ ";
95
+
96
+ Object.defineProperty(exports, \\ "__esModule\\ ", {
97
+ value : true
98
+ } );
99
+ exports.default = void 0;
100
+
101
+ var _react = _interopRequireWildcard(require(\\ "react\\ "));
102
+
103
+ var _reactIntl = require(\\ "react-intl\\ ");
104
+
105
+ function _getRequireWildcardCache() { if (typeof WeakMap !== \\" function\\ " ) return null ; var cache = new WeakMap (); _getRequireWildcardCache = function () { return cache ; }; return cache ; }
106
+
107
+ function _interopRequireWildcard(obj) { if (obj && obj .__esModule ) { return obj; } if (obj === null || typeof obj !== \\" object\\ " && typeof obj !== \\" function\\ " ) { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache .get (obj ); } var newObj = { } ; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object .prototype .hasOwnProperty .call (obj , key )) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj , key ) : null ; if (desc && (desc .get || desc .set )) { Object .defineProperty (newObj , key , desc ); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache .set (obj , newObj ); } return newObj; }
108
+
109
+ // @react-intl project:amazing
110
+ const msgs = {
111
+ header : (0 , _reactIntl .defineMessage )({
112
+ \\" id\\ " : \\" foo.bar.baz\\ " ,
113
+ \\" defaultMessage\\ " : \\" Hello World!\\ "
114
+ }),
115
+ content : (0 , _reactIntl .defineMessage )({
116
+ \\" id\\ " : \\" foo.bar.biff\\ " ,
117
+ \\" defaultMessage\\ " : \\" Hello Nurse!\\ "
118
+ }),
119
+ kittens : (0 , _reactIntl .defineMessage )({
120
+ \\" id\\ " : \\" app.home.kittens\\ " ,
121
+ \\" defaultMessage\\ " : \\" {count, plural, =0 {\\\\ uD83D\\\\ uDE2D} one {# kitten} other {# kittens}}\\ "
122
+ }),
123
+ trailingWhitespace : (0 , _reactIntl .defineMessage )({
124
+ \\" id\\ " : \\" trailing.ws\\ " ,
125
+ \\" defaultMessage\\ " : \\" Some whitespace \\ "
126
+ }),
127
+ escaped : (0 , _reactIntl .defineMessage )({
128
+ \\" id\\ " : \\" escaped.apostrophe\\ " ,
129
+ \\" defaultMessage\\ " : \\" A quoted value ''{value}'\\ "
130
+ })
131
+ } ;
132
+
133
+ class Foo extends _react.Component {
134
+ render () {
135
+ return (
136
+ /* #__PURE__*/
137
+ _react .default .createElement (\\"div \\", null ,
138
+ /* #__PURE__*/
139
+ _react .default .createElement (\\"h1 \\", null ,
140
+ /* #__PURE__*/
141
+ _react .default .createElement (_reactIntl .FormattedMessage , msgs .header )),
142
+ /* #__PURE__*/
143
+ _react.default.createElement(\\"p \\", null ,
144
+ /* #__PURE__*/
145
+ _react .default .createElement (_reactIntl .FormattedMessage , msgs .content )),
146
+ /* #__PURE__*/
147
+ _react.default.createElement(\\"p \\", null ,
148
+ /* #__PURE__*/
149
+ _react .default .createElement (_reactIntl .FormattedMessage , msgs .kittens )))
150
+ );
151
+ }
152
+
153
+ }
154
+
155
+ exports.default = Foo;"
156
+ ` ;
157
+
158
+ exports [` emit asserts for: output match: defineMessage 3` ] = `
159
+ Array [
160
+ Object {
161
+ " defaultMessage" : " Hello World!" ,
162
+ " description" : " The default message" ,
163
+ " id" : " foo.bar.baz" ,
164
+ } ,
165
+ Object {
166
+ " defaultMessage" : " Hello Nurse!" ,
167
+ " description" : " Another message" ,
168
+ " id" : " foo.bar.biff" ,
169
+ } ,
170
+ Object {
171
+ " defaultMessage" : " {count, plural, =0 {😭} one {# kitten} other {# kittens}}" ,
172
+ " description" : " Counts kittens" ,
173
+ " id" : " app.home.kittens" ,
174
+ } ,
175
+ Object {
176
+ " defaultMessage" : " Some whitespace " ,
177
+ " description" : " Whitespace" ,
178
+ " id" : " trailing.ws" ,
179
+ } ,
180
+ Object {
181
+ " defaultMessage" : " A quoted value ''{value}'" ,
182
+ " description" : " Escaped apostrophe" ,
183
+ " id" : " escaped.apostrophe" ,
184
+ } ,
185
+ ]
186
+ ` ;
187
+
58
188
exports [` emit asserts for: output match: defineMessages 1` ] = `
59
189
Object {
60
190
" messages" : Array [
0 commit comments