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

fix: Adding defineConfig() to cspell-types #5372

Closed
wants to merge 2 commits into from

Conversation

movahhedi
Copy link
Contributor

Closes #5358

@Jason3S Jason3S changed the title feat: Adding defineConfig() to cspell-types fix: Adding defineConfig() to cspell-types Mar 12, 2024
@Jason3S
Copy link
Collaborator

Jason3S commented Mar 14, 2024

@movahhedi,

Two things:

  1. The tests are failing because the API changed without updating the snapshot. The purpose of the test is to help catch accidental changes to the API.
    To fix:

    cd packages/cspell-types
    pnpm t -- -u
  2. There should be a unit test for the code. Something like:
    packages/cspell-types/src/defineConfig.test.ts

    import { describe, expect, test } from 'vitest';
    
    import { defineConfig } from './defineConfig.js';
    
    describe('defineConfig', () => {
        test('defineConfig is a pure pass-through', () => {
            const config = { name: 'test' };
            Object.freeze(config);
            expect(defineConfig(config)).toBe(config);
        });
    });

@movahhedi
Copy link
Contributor Author

Done.

@movahhedi
Copy link
Contributor Author

The purpose of the test is to help catch accidental changes to the API.
To fix:

cd packages/cspell-types
pnpm t -- -u

I suggest adding this to package.json's scripts.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 14, 2024

@movahhedi,

The purpose of the test is to help catch accidental changes to the API.
To fix:

cd packages/cspell-types
pnpm t -- -u

I suggest adding this to package.json's scripts.

I can see the point. It hadn't been added because the API doesn't change very often.

Looks like it is still breaking in other modules.

If you run the following from the root, it will show where the tests break:

pnpm ib
pnpm t

It is most likely in packages/cspell-lib and packages/cspell.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 14, 2024

Done.

Thank you.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 25, 2024

@movahhedi,

There was a script in the top level package.json file that I had forgotten about: test:update-snapshots. I tried to update your PR directly, but I wasn't able to push the changes.

Replaced by #5399

@Jason3S Jason3S closed this Mar 25, 2024
@movahhedi
Copy link
Contributor Author

movahhedi commented Mar 25, 2024

Very well.
Thanks.

In these little occasions, ping me, I'll try to be quick.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 25, 2024

@movahhedi,

Thank you for the PR.

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.

💡: cspell-define-config package: add to docs
2 participants