From 85ada6cd0a96116adf3cdb2bb4cdf65afedc8bb3 Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Mon, 11 Nov 2024 10:04:29 +0000 Subject: [PATCH] test: add root option to loadConfig in options test --- core/cli/test/options.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/cli/test/options.test.ts b/core/cli/test/options.test.ts index 6b98dd439..9555a0d56 100644 --- a/core/cli/test/options.test.ts +++ b/core/cli/test/options.test.ts @@ -29,7 +29,7 @@ options: `) ) - const config = await loadConfig(logger, { validate: false }) + const config = await loadConfig(logger, { validate: false, root: process.cwd() }) const plugin = config.plugins['app root'] expect(plugin.valid).toBe(true) expect((plugin as Valid).value.rcFile?.options.hooks[0].Test.baz).toEqual('bar') @@ -49,7 +49,7 @@ options: `) ) - const config = await loadConfig(logger, { validate: false }) + const config = await loadConfig(logger, { validate: false, root: process.cwd() }) const plugin = config.plugins['app root'] expect(plugin.valid).toBe(true) expect((plugin as Valid).value.rcFile?.options.hooks[0].Test.hello).toEqual('world') @@ -66,7 +66,7 @@ options: `) ) - const config = await loadConfig(logger, { validate: false }) + const config = await loadConfig(logger, { validate: false, root: process.cwd() }) const plugin = config.plugins['app root'] expect(plugin.valid).toBe(true) expect((plugin as Valid).value.rcFile?.options.hooks[0].Test.hello).toBeUndefined() @@ -86,7 +86,7 @@ options: `) ) - const config = await loadConfig(logger, { validate: false }) + const config = await loadConfig(logger, { validate: false, root: process.cwd() }) const plugin = config.plugins['app root'] expect(plugin.valid).toBe(true) expect((plugin as Valid).value.rcFile?.options.hooks[0].Test.hello).toEqual('bar') @@ -102,7 +102,7 @@ options: `) ) - expect(loadConfig(logger, { validate: false })).rejects.toThrowErrorMatchingInlineSnapshot( + expect(loadConfig(logger, { validate: false, root: process.cwd() })).rejects.toThrowErrorMatchingInlineSnapshot( `"cannot reference plugin options when specifying options"` ) }) @@ -122,7 +122,7 @@ options: expect.assertions(2) try { - await loadConfig(logger, { validate: false }) + await loadConfig(logger, { validate: false, root: process.cwd() }) } catch (error) { expect(error.details.split('\n\n')).toHaveLength(3) expect(error.details).toMatchInlineSnapshot(`