最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - How to make NextJS 15 dynamic CSS generation blank? - Stack Overflow

programmeradmin4浏览0评论

Earlier I was using NextJS 12 version & we stop generating the dynamic CSS class while writing the snapshot in React Testing Library by using the below method:

mocks\styled-jsx\css.js

function css() {}
export const resolve = () => ''    
css.global = () => ''    
css.resolve = resolve    
export default css

& also defined in jext.config.js

const jestConfig = {
  moduleNameMapper: {
    '\\.(css)$': '<rootDir>/__mocks__/styled-jsx/css.js',

When I was running the test case then dynamic CSS class was not generating in snapshot testing.

But when I upgrade to NextJS 15 version, then this css() is not working. I have tried a lot but not getting the answer & dynamic class is generating always.

Please provide the solution if you have any.

发布评论

评论列表(0)

  1. 暂无评论