-
Notifications
You must be signed in to change notification settings - Fork 244
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
Migrate toolbox-linter to jest #674
Comments
jest should work! Although, I don't think there's any particular portability issues with the code itself. The "test" script in How much work this is depends on how much should be migrated to jest. The existing tests have this structure: withFixture("thumbnails2", () =>
assertMatch(
`${StoryMetadataThumbnailsAreOk.name} - publisher-logo-src missing`,
runNetworkTest(
StoryMetadataThumbnailsAreOk,
"https://regular-biology.glitch.me/"
),
"publisher-logo-src"
)
); The three "custom" functions here are:
So after these changes, the tests would look something like: withFixture("thumbnails2", () =>
test(`${StoryMetadataThumbnailsAreOk.name} - publisher-logo-src missing`, () => {
const context = getNetworkContext("https://regular-biology.glitch.me/");
const rule = new StoryMetadataThumbnailsAreOk();
expect(rule.run(context)).toBe("publisher-logo-src");
});
); Is this about you're expecting? (Also, I unfortunately don't have time to work on this now.) |
I simply want to avoid having to maintain two completely different test setups. |
The custom setup is very hard to maintain and not very portable.
@ithinkihaveacat do you see reasons why this wouldn't work?
This also addresses #668
The text was updated successfully, but these errors were encountered: