提交 9a102b75 编写于 作者: dcloud_wdl's avatar dcloud_wdl

Merge remote-tracking branch 'origin/dev' into alpha

......@@ -20,7 +20,7 @@ function getApiFailed(describe, api) {
describes.forEach(d => {
d?.describe && describe(d.describe, () => {
d?.tests && d.tests.forEach(api => {
it(api, ()=>{
it(api, () => {
const failed = getApiFailed(d.describe, api)
if (failed) {
const parts = failed.split('\n')
......@@ -35,3 +35,12 @@ describes.forEach(d => {
})
})
})
if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
describe('testTypeFromAppJs', () => {
it("jest_testTypeFromAppJs", async () => {
const res = await page.callMethod('jest_testTypeFromAppJs')
expect(res).toEqual(true)
})
})
}
\ No newline at end of file
......@@ -21,6 +21,9 @@
</template>
<script lang="ts">
import { runTests, Result } from '../../uni_modules/uts-tests'
// #ifdef APP-IOS
import { testTypeFromAppJs, Options } from '@/uni_modules/uts-ios-tests'
// #endif
export default {
data() {
return {
......@@ -47,6 +50,13 @@ export default {
this.resultArray.push(resultMap[key] as Result)
}
},
// #ifdef APP-IOS
jest_testTypeFromAppJs() {
return testTypeFromAppJs({
num: 1
} as Options)
}
// #endif
},
}
</script>
......
{
"id": "uts-ios-tests",
"displayName": "uts-ios-tests",
"version": "1.0.0",
"description": "uts-ios-tests",
"keywords": [
"uts-ios-tests"
],
"repository": "",
"engines": {
"HBuilderX": "^3.6.8"
},
"dcloudext": {
"type": "uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u",
"alipay": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-android": "u",
"app-ios": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
# uts-ios-tests
### 开发文档
[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html)
[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)
[Hello UTS](https://gitcode.net/dcloud/hello-uts)
\ No newline at end of file
import { Options } from '../interface.uts';
export function testTypeFromAppJs(options : Options) {
return options instanceof Options
}
export {
Options
}
\ No newline at end of file
export type Options = {
num: number
}
\ No newline at end of file
......@@ -46,6 +46,28 @@ export function testDate() : Result {
// // #endif
})
test('toXString', () => {
const event = new Date('1995-12-17T03:24:00');
// #ifndef APP-ANDROID
expect(event.toString()).toEqual("Sun Dec 17 1995 03:24:00 GMT+0800");
expect(event.toTimeString()).toEqual("03:24:00 GMT+0800");
// #endif
expect(event.toISOString()).toEqual("1995-12-16T19:24:00.000Z");
expect(event.toJSON()).toEqual("1995-12-16T19:24:00.000Z");
expect(event.toDateString()).toEqual("Sun Dec 17 1995");
const event2 = new Date('2014-01-09 22:00:00');
// #ifndef APP-ANDROID
expect(event2.toString()).toEqual("Thu Jan 09 2014 22:00:00 GMT+0800");
expect(event2.toTimeString()).toEqual("2014-01-09T14:00:00.000Z");
// #endif
expect(event2.toISOString()).toEqual("2014-01-09T14:00:00.000Z");
expect(event2.toJSON()).toEqual("Thu Jan 09 2014");
expect(event2.toDateString()).toEqual("22:00:00 GMT+0800");
})
test('getDate', () => {
const birthday = new Date('August 19, 1975 23:15:30');
const date1 = birthday.getDate();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册