import * as Test from "https://deno.land/std@0.224.0/assert/mod.ts";

import Bundle from "./mod.ts";
const {outputFiles} = await Bundle(
    // directory to work from
    import.meta.resolve('./test/'),

    // ESBuild configuration (entry points are relative to "directory"):
    {entryPoints:["entry"]},

    // import map (if omitted, will scan for a deno configuration within "directory" and use that)
    {"imports": {
        "entry": "./app.tsx",
        "react": "https://esm.sh/preact@10.22.0/compat",
        "react/": "https://esm.sh/preact@10.22.0/compat/"
    }}
);

for(const item of outputFiles){
    // do something with the output...
    console.log(item.text.substring(0, 200));
}

Deno.test("check", ()=>{
    Test.assert(outputFiles?.length == 1);
    Test.assert(outputFiles[0].text.length > 1000);
})
