Skip to content

Commit

Permalink
fix(rn-runner): 兼容 win 路径分隔符
Browse files Browse the repository at this point in the history
  • Loading branch information
biorz authored and ZakaryCode committed Aug 1, 2023
1 parent d9eaa3e commit 8581aac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
`;
4 changes: 2 additions & 2 deletions packages/taro-rn-runner/__tests__/components.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('build_components', () => {
return {
...others,
input: Object.entries(input as Record<string, string>).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') }
Expand All @@ -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 () => {
Expand Down

0 comments on commit 8581aac

Please sign in to comment.