# unit-test **Repository Path**: wangjie12138/unit-test ## Basic Information - **Project Name**: unit-test - **Description**: 基于vue-cli3.0前端单元测试基本用法 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于vue前端单元测试 - 两种主流测试框架的基本使用方法 1. 函数测试 2. 组件测试 - 渲染数据 ```HelloWorld组件``` - mock函数 ```son组件``` 3. 异步测试 ```acycn``` ## jest对比mocha - jest是facebook开源的测试框架,集成mocha sinon```间谍函数``` chai```断言语法``` moxios```异步```的功能 - 语法 | 功能 |jest语法 | mocha+chai语法 | | -------- | -----: | :----: | | 判断基本数据类型相等 | toBe | to.be.equal | | 引用数据类型 | to.be.deep.equal | | toEqual | | 判断相等 | to.be.not.equal(1) | not.toBe(0) |