Skip to content

Commit

Permalink
Merge pull request #1676 from NullVoxPopuli/cleanup
Browse files Browse the repository at this point in the history
Remove skipped tests that have been skipped for years
  • Loading branch information
NullVoxPopuli authored Feb 20, 2024
2 parents e700aa2 + c23c558 commit 0fd7064
Showing 1 changed file with 1 addition and 148 deletions.
149 changes: 1 addition & 148 deletions packages/ember-repl/test-app/tests/rendering/compile-js-test.gts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { click, render } from '@ember/test-helpers';
import { module, skip, test } from 'qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';

import { compileJS } from 'ember-repl/formats/gjs';
Expand Down Expand Up @@ -127,151 +127,4 @@ module('compileJS()', function (hooks) {

assert.dom().hasText('Custom extra module');
});

module('in AMD / requirejs environments (old-style)', function () {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((window as any).require) {
skip('can optionally import from npm via skypack', async function (assert) {
assert.expect(4);

let compile = async () => {
let template = `
import { Changeset as createChangeset } from 'validated-changeset';
let changeset = createChangeset({});
<template>
<a>{{changeset.isValid}}</a>
<b>{{changeset.isPristine}}</b>
</template>
`;

let { component, name, error } = await compileJS(template, {}, { skypack: true });

assert.ok(error);
assert.notOk(name);
assert.ok(/using native ESM is not allowed/.test(error?.toString() || ''));

return component;
};

await render(
<template>
{{#let (compile) as |CustomComponent|}}
<Await @promise={{CustomComponent}} />
{{/let}}
</template>
);

assert.dom('a').doesNotExist();
});

skip('can import from the skypack CDN', async function (assert) {
assert.expect(4);

let compile = async () => {
let template = `
import { Changeset as createChangeset } from 'https://cdn.skypack.dev/validated-changeset';
let changeset = createChangeset({});
<template>
<a>{{changeset.isValid}}</a>
<b>{{changeset.isPristine}}</b>
</template>
`;

let { component, name, error } = await compileJS(template, {}, { skypack: true });

assert.ok(error);
assert.notOk(name);
assert.ok(/using native ESM is not allowed/.test(error?.toString() || ''));

return component;
};

await render(
<template>
{{#let (compile) as |CustomComponent|}}
<Await @promise={{CustomComponent}} />
{{/let}}
</template>
);

assert.dom('a').doesNotExist();
});
}
});

module('in ESM environments', function () {
skip('can optionally import from npm via skypack', async function (assert) {
assert.expect(4);

let compile = async () => {
let template = `
import { Changeset as createChangeset } from 'validated-changeset';
let changeset = createChangeset({});
<template>
<a>{{changeset.isValid}}</a>
<b>{{changeset.isPristine}}</b>
</template>
`;

let { component, name, error } = await compileJS(template, {}, { skypack: true });

assert.notOk(error);
assert.ok(name);

return component;
};

await render(
<template>
{{#let (compile) as |CustomComponent|}}
<Await @promise={{CustomComponent}} />
{{/let}}
</template>
);

assert.dom('a').hasText('true');
assert.dom('b').hasText('true');
});

skip('can import from a CDN', async function (assert) {
assert.expect(4);

let compile = async () => {
let template = `
import { Changeset as createChangeset } from 'https://esm.run/validated-changeset';
let changeset = createChangeset({});
<template>
<a>{{changeset.isValid}}</a>
<b>{{changeset.isPristine}}</b>
</template>
`;

let { component, name, error } = await compileJS(template, {}, { skypack: true });

assert.notOk(error);
assert.ok(name);

return component;
};

await render(
<template>
{{#let (compile) as |CustomComponent|}}
<Await @promise={{CustomComponent}} />
{{/let}}
</template>
);

assert.dom('a').hasText('true');
assert.dom('b').hasText('true');
});
});
});

0 comments on commit 0fd7064

Please sign in to comment.