Open cailborg opened 1 year ago
We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report. To ensure accuracy in future PRs, please see these guidelines. A quick fix for this PR: rebase it; your next report should be accurate.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/utilities/transformName.ts | 2 | 3 | 66.67% | ||
<!-- | Total: | 2 | 3 | 66.67% | --> |
Totals | |
---|---|
Change from base Build 6474855251: | -0.09% |
Covered Lines: | 497 |
Relevant Lines: | 732 |
Hey, thank you for the PR.
I think we should make sure that it does also work if there are numbers in the name, what do you think?
No worries, should work with numbers now. Input:
Output:
Hey, sadly with the change to the function we run into issues so that the test does not pass anymore:
Use npx jest transformName
to run the test locally.
FAIL tests/unit/transformName.test.ts transformName ✓ default case (1 ms) ✕ camelCase (3 ms) ✓ kebab-case
● transformName › camelCase
expect(received).toStrictEqual(expected) // deep equality - Expected - 6 + Received + 6 Array [ - "fooBar", - "fooBar", - "fooBar", - "foo123bar", + " FooBar", + "-fooBar", + "_FOOBAR", + "foo123Bar", "fooBar", "fooBarFooBarFooBarFooBar", - "equipmentclassName", - "equipmentClassname", + "equipmentClassName", "equipmentClassName", "equipmentClassName", + " EquipmentClassName", ] 35 | test('camelCase', () => { 36 | const transformed = strings.map(string => transformName(string, 'camelCase')) > 37 | expect(transformed).toStrictEqual([ | ^ 38 | 'fooBar', 39 | 'fooBar', 40 | 'fooBar',
Hey @cailborg would you be able to update this so we can merge it?
Checks for existing camelCase before applying a conversion
OUTPUT