bolt-js
bolt-js copied to clipboard
Feature Request - Create a Block/View validator
Description
Many of my Slack projects have 100% test coverage but testing only helps to make sure my handler is working correct, it doesn't help detect when static content like blocks are "broken". For example, if I have view with a title that's too long, the view will compile but will throw a runtime error when used.
Here's what I'd love to have:
// someHandler.test.ts
import 'jest';
import { validator } from '@slack/bolt`;
import { myView } from '../slack/blocks/someHandler';
describe('some functionality including a static view`, () => {
it('uses a valid view', () => {
expect(() => validator.validateView(myView)).not.toThrowError();
});
});
I'm semi-sure it's not possible to improve the types of views/blocks to enforce these types of things, so this seems like the next best thing. Also it seems like yall already have this code somewhere, so it shouldn't be terribly difficult to add!

What type of issue is this? (place an x
in one of the [ ]
)
- [ ] bug
- [x] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [ ] discussion
Requirements (place an x
in each of the [ ]
)
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Hey @SpencerKaiser!
Thanks for submitting this feature request! I agree with you it would be nice to have something like this shipping with bolt. We don't currently have bandwidth to work on this but will reevaluate when we do our roadmap planning. As always, we are open to contributions! If it is something you are interested in contributing, I can work with you to get it in!
Thanks again!
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out.
Setting this issue to a milestone for now, so that it will be surfaced in the next round of roadmap planning!
This would be an awesome feature.
This would be a great improvement to developing Slack applications 🙏