|
1 | 1 | import { click, render } from '@ember/test-helpers';
|
2 |
| -import { module, skip, test } from 'qunit'; |
| 2 | +import { module, test } from 'qunit'; |
3 | 3 | import { setupRenderingTest } from 'ember-qunit';
|
4 | 4 |
|
5 | 5 | import { compileJS } from 'ember-repl/formats/gjs';
|
@@ -127,151 +127,4 @@ module('compileJS()', function (hooks) {
|
127 | 127 |
|
128 | 128 | assert.dom().hasText('Custom extra module');
|
129 | 129 | });
|
130 |
| - |
131 |
| - module('in AMD / requirejs environments (old-style)', function () { |
132 |
| - // eslint-disable-next-line @typescript-eslint/no-explicit-any |
133 |
| - if ((window as any).require) { |
134 |
| - skip('can optionally import from npm via skypack', async function (assert) { |
135 |
| - assert.expect(4); |
136 |
| - |
137 |
| - let compile = async () => { |
138 |
| - let template = ` |
139 |
| - import { Changeset as createChangeset } from 'validated-changeset'; |
140 |
| -
|
141 |
| - let changeset = createChangeset({}); |
142 |
| -
|
143 |
| - <template> |
144 |
| - <a>{{changeset.isValid}}</a> |
145 |
| - <b>{{changeset.isPristine}}</b> |
146 |
| - </template> |
147 |
| - `; |
148 |
| - |
149 |
| - let { component, name, error } = await compileJS(template, {}, { skypack: true }); |
150 |
| - |
151 |
| - assert.ok(error); |
152 |
| - assert.notOk(name); |
153 |
| - assert.ok(/using native ESM is not allowed/.test(error?.toString() || '')); |
154 |
| - |
155 |
| - return component; |
156 |
| - }; |
157 |
| - |
158 |
| - await render( |
159 |
| - <template> |
160 |
| - {{#let (compile) as |CustomComponent|}} |
161 |
| - <Await @promise={{CustomComponent}} /> |
162 |
| - {{/let}} |
163 |
| - </template> |
164 |
| - ); |
165 |
| - |
166 |
| - assert.dom('a').doesNotExist(); |
167 |
| - }); |
168 |
| - |
169 |
| - skip('can import from the skypack CDN', async function (assert) { |
170 |
| - assert.expect(4); |
171 |
| - |
172 |
| - let compile = async () => { |
173 |
| - let template = ` |
174 |
| - import { Changeset as createChangeset } from 'https://cdn.skypack.dev/validated-changeset'; |
175 |
| -
|
176 |
| - let changeset = createChangeset({}); |
177 |
| -
|
178 |
| - <template> |
179 |
| - <a>{{changeset.isValid}}</a> |
180 |
| - <b>{{changeset.isPristine}}</b> |
181 |
| - </template> |
182 |
| - `; |
183 |
| - |
184 |
| - let { component, name, error } = await compileJS(template, {}, { skypack: true }); |
185 |
| - |
186 |
| - assert.ok(error); |
187 |
| - assert.notOk(name); |
188 |
| - assert.ok(/using native ESM is not allowed/.test(error?.toString() || '')); |
189 |
| - |
190 |
| - return component; |
191 |
| - }; |
192 |
| - |
193 |
| - await render( |
194 |
| - <template> |
195 |
| - {{#let (compile) as |CustomComponent|}} |
196 |
| - <Await @promise={{CustomComponent}} /> |
197 |
| - {{/let}} |
198 |
| - </template> |
199 |
| - ); |
200 |
| - |
201 |
| - assert.dom('a').doesNotExist(); |
202 |
| - }); |
203 |
| - } |
204 |
| - }); |
205 |
| - |
206 |
| - module('in ESM environments', function () { |
207 |
| - skip('can optionally import from npm via skypack', async function (assert) { |
208 |
| - assert.expect(4); |
209 |
| - |
210 |
| - let compile = async () => { |
211 |
| - let template = ` |
212 |
| - import { Changeset as createChangeset } from 'validated-changeset'; |
213 |
| -
|
214 |
| - let changeset = createChangeset({}); |
215 |
| -
|
216 |
| - <template> |
217 |
| - <a>{{changeset.isValid}}</a> |
218 |
| - <b>{{changeset.isPristine}}</b> |
219 |
| - </template> |
220 |
| - `; |
221 |
| - |
222 |
| - let { component, name, error } = await compileJS(template, {}, { skypack: true }); |
223 |
| - |
224 |
| - assert.notOk(error); |
225 |
| - assert.ok(name); |
226 |
| - |
227 |
| - return component; |
228 |
| - }; |
229 |
| - |
230 |
| - await render( |
231 |
| - <template> |
232 |
| - {{#let (compile) as |CustomComponent|}} |
233 |
| - <Await @promise={{CustomComponent}} /> |
234 |
| - {{/let}} |
235 |
| - </template> |
236 |
| - ); |
237 |
| - |
238 |
| - assert.dom('a').hasText('true'); |
239 |
| - assert.dom('b').hasText('true'); |
240 |
| - }); |
241 |
| - |
242 |
| - skip('can import from a CDN', async function (assert) { |
243 |
| - assert.expect(4); |
244 |
| - |
245 |
| - let compile = async () => { |
246 |
| - let template = ` |
247 |
| - import { Changeset as createChangeset } from 'https://esm.run/validated-changeset'; |
248 |
| -
|
249 |
| - let changeset = createChangeset({}); |
250 |
| -
|
251 |
| - <template> |
252 |
| - <a>{{changeset.isValid}}</a> |
253 |
| - <b>{{changeset.isPristine}}</b> |
254 |
| - </template> |
255 |
| - `; |
256 |
| - |
257 |
| - let { component, name, error } = await compileJS(template, {}, { skypack: true }); |
258 |
| - |
259 |
| - assert.notOk(error); |
260 |
| - assert.ok(name); |
261 |
| - |
262 |
| - return component; |
263 |
| - }; |
264 |
| - |
265 |
| - await render( |
266 |
| - <template> |
267 |
| - {{#let (compile) as |CustomComponent|}} |
268 |
| - <Await @promise={{CustomComponent}} /> |
269 |
| - {{/let}} |
270 |
| - </template> |
271 |
| - ); |
272 |
| - |
273 |
| - assert.dom('a').hasText('true'); |
274 |
| - assert.dom('b').hasText('true'); |
275 |
| - }); |
276 |
| - }); |
277 | 130 | });
|
0 commit comments