davelosert/vitest-coverage-report-action

Allow defining thresholds inline

Closed this issue · 2 comments

const thresholds = await parseThresholds(viteConfigPath);

Would you accept a change that would allow defining the thresholds inline as opposed to loading the vite.config?
We're not running a vanilla config, and it's defined in TS, I am not sure exactly how that would work, but a good option would be to just allow opting in to inlining the thresholds as arguments.

@seivan : Thanks for the issue.

So if it is just defined in the TS file, you can set the vite-config-path to that like so:

    - name: 'Report Coverage'
      uses:  davelosert/vitest-coverage-report-action@v1
      with:
        vite-config-path: vite.config.ts

As long as the coverage is defined directly in that file, that'll work.
I kind of follow on the idea here of vite to define everything within that config file.

However, if above suggestion does not work for you, I'll be happy to draw something up next week that allows you to define thresholds manually.

I am going to close this, as ts-configs are now read on default, so this shouldn't be an issue anymore. 🙂