-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from caoyang818/release-3.6.8-app
fix: 修复var regexp = getRegExp()没有转换成var regexp = new RegExp()的问题以及补充单元测试
- Loading branch information
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import transform from '../src' | ||
import { baseOptions } from './utils' | ||
|
||
describe('wxs.ts测试', () => { | ||
test('wxs文件中的var regexp = getRegExp()转换为var regexp = new RegExp()', () => { | ||
const wxsCode = `var regexp = getRegExp();` | ||
baseOptions.sourcePath = '.wxs' | ||
const { code } = transform({ | ||
...baseOptions, | ||
code: wxsCode, | ||
}) | ||
expect(code).toEqual('var regexp = new RegExp();') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters