Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Dec 6, 2024
1 parent 32bca78 commit 3156cb5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/ember-auto-import/ts/tests/inserter-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,22 @@ import { join } from 'path';
import { Inserter } from '../inserter';
import BundleConfig from '../bundle-config';
import { BuildResult, Bundler } from '../bundler';
import Plugin from 'broccoli-plugin';

const { module: Qmodule, test } = QUnit;

class NoopPlugin extends Plugin {
build(): Promise<void> | void {
// noop
}
}

function asInputNode(obj: any) {
const plugin = new NoopPlugin([]);
Object.assign(plugin, obj);
return plugin as Bundler;
}

Qmodule('inserter', function (hooks) {
let builder: Builder;
let upstream: string;
Expand All @@ -28,7 +42,7 @@ Qmodule('inserter', function (hooks) {
async function build() {
let inserter = new Inserter(
new UnwatchedDir(upstream),
{ buildResult } as Bundler,
asInputNode({ buildResult }),
bundleConfig,
{
publicAssetURL,
Expand Down

0 comments on commit 3156cb5

Please sign in to comment.