Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbitrotting ruleserver tests #418

Merged
merged 2 commits into from
Nov 15, 2022
Merged

Unbitrotting ruleserver tests #418

merged 2 commits into from
Nov 15, 2022

Conversation

Yoric
Copy link
Contributor

@Yoric Yoric commented Nov 15, 2022

No description provided.

@Yoric Yoric requested a review from Gnuxie November 15, 2022 11:40
Comment on lines +62 to +63
let config = configRead();
if (!config?.web?.ruleServer?.enabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this.mjolnir will exist in the beforeAll hook, but this works too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, it didn't seem to exist.

await badUser.sendMessage(unprotectedRoom, {msgtype: 'm.text', body: 'Something bad and mean'});

await waitForRuleChange(this.config.web.address, this.mjolnir.config.web.port, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have forgot to add the change to waitForRuleChange?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that waitForRuleChange had already been refactored, just not its call sites.

import config from "../../src/config";
import { read as configRead } from "../../src/config";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to prevent this from happening again, the test should be added to the end of tsconfig.json.

@Yoric Yoric merged commit 81cd91c into main Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants