Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
chore: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed May 3, 2024
1 parent 59799e7 commit 1fdb758
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/utils/generate-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ function transformUseReferences(config: BotConfig) {
for (const plugins of Object.values(config.plugins)) {
for (const plugin of plugins) {
for (const use of plugin.uses) {
use.plugin = Value.Decode(githubPluginType(), use.plugin);
// This case happens if the object was not transformed before, otherwise the value can be safely be ignored
if (typeof use.plugin === "string") {
use.plugin = Value.Decode(githubPluginType(), use.plugin);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/__mocks__/test-default-conf-obj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const defaultConfig = {
skipBotEvents: true,
uses: [
{
plugin: "ubiquity/conversation-rewards@testing/ubiquibot-v2-testing",
plugin: "ubiquibot/conversation-rewards@testing/ubiquibot-v2-testing",
type: "github",
with: {
evmNetworkId: 100,
Expand Down
7 changes: 6 additions & 1 deletion tests/__mocks__/test-valid-conf-obj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ const validConfig = {
skipBotEvents: true,
uses: [
{
plugin: "ubiquity/conversation-rewards@testing/ubiquibot-v2-testing",
plugin: {
owner: "ubiquibot",
ref: "testing/ubiquibot-v2-testing",
repo: "conversation-rewards",
workflowId: "compute.yml",
},
type: "github",
with: {
evmNetworkId: 100,
Expand Down

0 comments on commit 1fdb758

Please sign in to comment.