Conversation
This was referenced Apr 1, 2024
nex3
approved these changes
Apr 2, 2024
js-api-spec/deprecations.test.ts
Outdated
| }); | ||
|
|
||
| describe('deprecation flags', () => { | ||
| it('warning emitted with no flags', done => { |
Contributor
There was a problem hiding this comment.
Nit: test case descriptions should generally form sentence fragments that describe the subject of describe() (that's why the test function is called it()—so you can read the whole thing as a sentence). So for example, you might write:
describe('a warning', () => {
it('is emitted with no flags', ...);
it('is emitted with different deprecation type silenced', ...);
// ...
});Also restructure test names to read as sentences
nex3
requested changes
Apr 3, 2024
| const extraDeprecations = Object.keys(deprecations).filter( | ||
| deprecation => !expectedDeprecations.includes(deprecation) | ||
| ); | ||
| expect(extraDeprecations).toBeEmptyArray(); |
Contributor
There was a problem hiding this comment.
We should check that everything in expectedDeprecations is in deprecations as well. Also, we should probably have some sort of test for the deprecation list in the JS API spec as well.
Member
Author
There was a problem hiding this comment.
Added an additional check that there are no missing deprecations either.
I also added some types which should ensure that there aren't any extra deprecations in these tests that aren't in the spec.
We now check that there are no missing deprecation types and also use types to ensure that every deprecation in the tests is also in the spec.
nex3
approved these changes
Apr 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See sass/sass#3826
[skip dart-sass]
[skip sass-embedded]