argyleink / open-props

CSS custom properties to help accelerate adaptive and consistent design.
https://open-props.style
MIT License
4.78k stars 193 forks source link

`npm run test` failing #371

Closed hirasso closed 1 year ago

hirasso commented 1 year ago

If I try to run the tests, I get the following error:

❯ npm run test

> open-props@1.5.8 test
> ava test/basic.test.cjs

  Should produce shadow :host props

  test/basic.test.cjs:40

   39: test('Should produce shadow :host props', async t => {  
   40:   t.assert(fs.existsSync('./open-props.shadow.min.css'))
   41:   t.assert(fs.existsSync('./easings.shadow.min.css'))   

  Value is not truthy:

  false

  › test/basic.test.cjs:40:5

  ─

  1 test failed
hirasso commented 1 year ago

Ah I see. First need to run npm run bundle. Maybe that should be done automatically when exectuting test?

{
  "test": "npm run bundle && ava test/basic.test.cjs",
}
argyleink commented 1 year ago

We could switch to that yeah. Could set it up using package.json pre script syntax too:

{
  "pretest": "npm run bundle",
  "test": "ava test/basic.test.cjs",
}

reason i dont have it now is i find it can be surprising and maybe resource wasteful to run the bundle every time before running tests. 🤷🏻

we'd also need to update actions and CI to be aware of the automated bundling before testing.

do you want to switch this issue to a workflow/feature request?

hirasso commented 1 year ago

I ended up not using Open Props in my project. So I'd like to hand this over to the maintainers of this project.