blog-angular icon indicating copy to clipboard operation
blog-angular copied to clipboard

Angular 笔记

Results 104 blog-angular issues
Sort by recently updated
recently updated
newest added

## Angular测试概念 Angular中分为两种测试方式: - 单元测试: 测试代码的自身行为。在用户看来好像什么也没有做,但可以确保其方法能达到期望的目的。单元测试应该测试一小段隔离的代码。 - E2E测试: 一种模拟用户行为的测试。使用e2e的JavaScript API代替我们在浏览器上做的手工操作,并且我们可以看到这个过程。E2E测试是对功能或多个交互的高级测试 > 参考文档 - [E2E测试](https://www.jianshu.com/p/74b6a2c7c23c) ## e2e 端到端测试(E2E)或也称为集成测试,是一种从高层概述确保我们的应用程序正常运行的好方法。通常,我们使用端到端测试来帮助确保我们的组件正常协同工作,从而凝聚地创建一个功能全面的功能。E2E测试不是单元测试。单元测试应该测试一小段隔离的代码,而E2E测试是对功能或多个交互的高级测试。端到端测试也是确保关键业务功能(如结帐和注册)经过良好测试的理想选择。我不会深入探讨单元测试与E2E测试的所有细节,而是着重于Angular中集成和E2E测试的工作方式。 对于我们的应用程序,我们希望确保每次去部署我们的应用程序时此核心功能都能正常工作。这是自动E2E测试的无价之宝。我们的E2E测试可以在浏览器中打开我们的应用程序并与我们的应用程序进行交互,以确保该功能正常运行。

E2E

# 单元测试案例 #### 管道 number-to-zh.pipe.ts ```ts import { Pipe, PipeTransform } from "@angular/core"; @Pipe({name: 'numberToZh'}) export class numberToZhPipe implements PipeTransform { transform(value: any, ...args: any[]) { switch(value) { case '1':...

单元测试

> 单元测试 一般都是给通用组件,指令 服务 管道这样的通用业务去写 页面级就用e2e测试 #### 语句 ``` toBe() 等同 === toNotBe() 等同 !== toBeDefined() 等同 !== undefined toBeUndefined() 等同 === undefined toBeNull() 等同 === null toBeTruthy() 等同 !!obj...

单元测试

- [tinymce github](https://github.com/tinymce/tinymce) #### 1. 安装tinymce ``` npm install --save tinymce ``` 或者 ``` yarn add tinymce ``` #### 2. 定义全局变量 你还需要在项目中的.\src\typing.d.ts中声明tinymce全局变量,不然会提示找不到tinymce ``` declare var tinymce: any; ``` #### 3....

插件集成

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. Commits See full diff in compare view [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=path-parse&package-manager=npm_and_yarn&previous-version=1.0.5&new-version=1.0.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter...

dependencies

Bumps [tar](https://github.com/npm/node-tar) from 2.2.1 to 2.2.2. Commits 523c5c7 2.2.2 7ecef07 Bump fstream to fix hardlink overwriting vulnerability 9fc84b9 Use {} for hardlink tracking instead of [] 15e59f1 Only track previously...

dependencies

Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.2.2 to 1.3.4. Commits ebdf849 1.3.4 ac57872 move all allocUnsafes to allocs for easier maintenance c64c950 1.3.3 0598ba1 fix .. in encodingLength 010aedb 1.3.2 0d0d593 backport encodingLength...

dependencies

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.5.0 to 2.8.9. Changelog Sourced from hosted-git-info's changelog. 2.8.9 (2021-04-07) Bug Fixes backport regex fix from #76 (29adfe5), closes #84 2.8.8 (2020-02-29) Bug Fixes #61 & #65...

dependencies

Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2. Commits See full diff in compare view Maintainer changes This version was pushed to npm by oss-bot, a new releaser for y18n since your...

dependencies

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.0 to 6.5.4. Commits 43ac7f2 6.5.4 f4bc72b package: bump deps 441b742 ec: validate that a point before deriving keys e71b2d9 lib: relint using eslint 8421a01 build(deps): bump...

dependencies