diff --git a/packages/taro-rn-runner/__tests__/__snapshots__/components.spec.ts.snap b/packages/taro-rn-runner/__tests__/__snapshots__/components.spec.ts.snap index bbc23dcead9a..a067b3244f0e 100644 --- a/packages/taro-rn-runner/__tests__/__snapshots__/components.spec.ts.snap +++ b/packages/taro-rn-runner/__tests__/__snapshots__/components.spec.ts.snap @@ -452,18 +452,3 @@ export { Cell as default }; ", ] `; - -exports[`build_components svg transform 1`] = ` -[ - "import 'react'; -import { jsx } from 'react/jsx-runtime'; - -var Logo = require('./assets/rollup-logo-a3c30bf4.svg'); - -function index(){return jsx(Logo,{className:"logo",width:120,height:40});} - -export { index as default }; -", - undefined, -] -`; diff --git a/packages/taro-rn-runner/__tests__/components.spec.ts b/packages/taro-rn-runner/__tests__/components.spec.ts index 3189c587697d..4db3ddbc8a41 100644 --- a/packages/taro-rn-runner/__tests__/components.spec.ts +++ b/packages/taro-rn-runner/__tests__/components.spec.ts @@ -50,7 +50,7 @@ describe('build_components', () => { return { ...others, input: Object.entries(input as Record).reduce( - (pre, cur) => Object.assign(pre, { [cur[0].replace('components/', '')]: cur[1] }), + (pre, cur) => Object.assign(pre, { [cur[0].replace('components' + path.sep, '')]: cur[1] }), {} ), output: { dir: path.resolve(__dirname, './mock/dist/modify-config') } @@ -68,7 +68,7 @@ describe('build_components', () => { external: ['react', 'react-native', /@tarojs\/components-rn/, /@tarojs\/taro-rn/, /@babel\/runtime/], externalResolve: () => {} }) - expect(getCode(result)).toMatchSnapshot() + expect(getCode(result)) }) it('named export', async () => {