babel-plugin-transform-taroapi 3.6.7-alpha.0 → 3.6.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ false;
9
9
  false;
10
10
 
11
11
  // 接口参数、回调或者返回值
12
- false;
12
+ true;
13
13
  false;
14
14
  false;
15
15
  false;
@@ -17,8 +17,8 @@ false;
17
17
  true;
18
18
 
19
19
  // 组件的属性
20
- false;
21
- false;
20
+ true;
21
+ true;
22
22
  false;"
23
23
  `;
24
24
 
@@ -25,7 +25,7 @@ const getNamedImports = (importSpecifiers: (t.ImportSpecifier | t.ImportDefaultS
25
25
  const babelTransform = (code = '') => babel.transform(code, { ast: true, configFile: false, plugins: [pluginOptions] })
26
26
 
27
27
  describe('babel-plugin-transform-taroapi', () => {
28
- test.skip('should work!', function () {
28
+ test('should work!', function () {
29
29
  const code = `
30
30
  import Taro, { setStorage, initPxTransform, param } from '${packageName}';
31
31
  initPxTransform(param)
@@ -39,7 +39,7 @@ describe('babel-plugin-transform-taroapi', () => {
39
39
  expect(result?.code).toMatchSnapshot()
40
40
  })
41
41
 
42
- test.skip('should leave other apis untouched', function () {
42
+ test('should leave other apis untouched', function () {
43
43
  const code = `
44
44
  import Taro from '${packageName}'
45
45
  Taro.noop
@@ -68,7 +68,7 @@ describe('babel-plugin-transform-taroapi', () => {
68
68
  expect((body[1].expression as t.MemberExpression)).toMatchObject(obj)
69
69
  })
70
70
 
71
- test.skip('should move static apis under "Taro"', function () {
71
+ test('should move static apis under "Taro"', function () {
72
72
  const code = `
73
73
  import { noop } from '${packageName}';
74
74
  noop;
@@ -96,7 +96,7 @@ describe('babel-plugin-transform-taroapi', () => {
96
96
  ))
97
97
  })
98
98
 
99
- test.skip('should not import taro duplicity', function () {
99
+ test('should not import taro duplicity', function () {
100
100
  const code = `
101
101
  import { Component } from '${packageName}';
102
102
  import Taro from '${packageName}';
@@ -114,7 +114,7 @@ describe('babel-plugin-transform-taroapi', () => {
114
114
  expect(t.isExpressionStatement(body[2])).toBeTruthy()
115
115
  })
116
116
 
117
- test.skip('should not go wrong when using an api twice', function () {
117
+ test('should not go wrong when using an api twice', function () {
118
118
  const code = `
119
119
  import Taro from '${packageName}';
120
120
  const animation = Taro.createAnimation({
@@ -132,7 +132,7 @@ describe('babel-plugin-transform-taroapi', () => {
132
132
  }).not.toThrowError()
133
133
  })
134
134
 
135
- test.skip('should preserve default imports', function () {
135
+ test('should preserve default imports', function () {
136
136
  const code = `
137
137
  import Taro from '${packageName}'
138
138
  console.log(Taro)
@@ -141,7 +141,7 @@ describe('babel-plugin-transform-taroapi', () => {
141
141
  expect(result?.code).toMatchSnapshot()
142
142
  })
143
143
 
144
- test.skip('should preserve assignments in left hands', function () {
144
+ test('should preserve assignments in left hands', function () {
145
145
  const code = `
146
146
  import Taro from '${packageName}'
147
147
  let animation
@@ -159,7 +159,7 @@ describe('babel-plugin-transform-taroapi', () => {
159
159
  expect(result?.code).toMatchSnapshot()
160
160
  })
161
161
 
162
- test.skip('should support rename of imported names', function () {
162
+ test('should support rename of imported names', function () {
163
163
  const code = `
164
164
  // import { inject as mobxInject, observer as mobxObserver } from '@tarojs/mobx'
165
165
  import { Component as TaroComponent } from '${packageName}';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-transform-taroapi",
3
- "version": "3.6.7-alpha.0",
3
+ "version": "3.6.7-alpha.1",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "lodash": "^4.17.21"