Skip to content

Commit 9f0e913

Browse files
committed
Don't load plugins in tests
This can affect the test behavior and results.
1 parent e098df0 commit 9f0e913

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

ci/dev/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ main() {
99
# information. We must also run it from the root otherwise coverage will not
1010
# include our source files.
1111
cd "$OLDPWD"
12-
./test/node_modules/.bin/jest "$@"
12+
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@"
1313
}
1414

1515
main "$@"

src/node/routes/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ export const register = async (
114114
})
115115
})
116116

117-
const workingDir = args._ && args._.length > 0 ? path.resolve(args._[args._.length - 1]) : undefined
118-
const pluginApi = new PluginAPI(logger, process.env.CS_PLUGIN, process.env.CS_PLUGIN_PATH, workingDir)
119-
await pluginApi.loadPlugins()
120-
pluginApi.mount(app, wsApp)
117+
if (!process.env.CS_DISABLE_PLUGINS) {
118+
const workingDir = args._ && args._.length > 0 ? path.resolve(args._[args._.length - 1]) : undefined
119+
const pluginApi = new PluginAPI(logger, process.env.CS_PLUGIN, process.env.CS_PLUGIN_PATH, workingDir)
120+
await pluginApi.loadPlugins()
121+
pluginApi.mount(app, wsApp)
122+
}
121123

122124
app.use(bodyParser.json())
123125
app.use(bodyParser.urlencoded({ extended: true }))

0 commit comments

Comments
 (0)