tompascall/riot-jest-transformer

How to register preProcessors and postProcessors?

Acesmndr opened this issue ยท 8 comments

Since I use scss my tests are failing.
Adding support for these? https://riot.js.org/compiler/#pre-processors

image

Hi! Have you registered your scss preprocessor in jest config at transform section?

@tompascall I tried it but still it's not working. Here's my jest.config.js:

{
    "moduleNameMapper": {
        "\\.(css|scss)$": "identity-obj-proxy"
    },
    "transform": {
        "^.+\\.jsx?$": "babel-jest",
        "^.+\\.riot$": "riot-jest-transformer",
        ".+\\.scss$": "jest-css-modules-transform"
    },
    "coverageDirectory": "../coverage"
}

What version of riot-jest-transformer do you use? There is a new version for riot v4

I tried to register jest-css-modules-transform in the demo project of this repo, and imported an scss file. The tests can run without failing.

@tompascall I'm using the latest version of riot-jest-transformer. Actually I'm migrating from v3 of riot to v4.
It's an opensource project so I've created a PR for the test specs here:
https://github.com/Acesmndr/chrome-extension-boilerplate-riot/pull/8/files
(Just experimenting with the pageone specs. I had just copied the specs from my riot v3 code so please disregard the pagetwo specs, I couldn't get the specs working to start with it)
or for the source code for my riot components: https://github.com/Acesmndr/chrome-extension-boilerplate-riot/tree/technical/riot-v4-tests/src/popup/components

I'm on the update, I'd like to publish the next version of transformer till tomorrow.

Sure! ๐Ÿ™‡๐Ÿš€

Resolved with the new version of riot-jest-transformer. Working and tested in Acesmndr/chrome-extension-boilerplate-riot#9 . ๐Ÿ™‡ ๐ŸŽ‰ ๐ŸŽ‰