-file,-updateModule,publish?

This commit is contained in:
Jacob Nguyen
2024-06-08 00:20:24 -05:00
parent 45665292ae
commit bf071b7af4
11 changed files with 78 additions and 87 deletions

View File

@@ -56,9 +56,11 @@ vi.mock('discord.js', async (importOriginal) => {
});
function createRandomPlugin (s: 'go', mut?: Partial<Module>) {
return CommandInitPlugin(({ module, updateModule }) => {
return CommandInitPlugin(({ module }) => {
if(mut) {
updateModule(mut)
for(const [k,v] of Object.entries(mut)) {
module[k] = v
}
}
return s == 'go'
? controller.next()
@@ -105,8 +107,10 @@ test ('mutate with init plugins', async () => {
const deps = mockDeps()
const plugins = createRandomPlugin('go', { name: "abc" })
const mod = createRandomModule([plugins])
console.log(mod)
const s = await callInitPlugins(mod, deps, false)
expect(s.name).not.equal(mod.name)
console.log(s)
expect("abc").equal(s.name)
})