Skip to content

Commit 72e0aa2

Browse files
docs: update.
1 parent b6daeea commit 72e0aa2

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9+
## [3.0.0-alpha] - 2024-10-30
10+
11+
### [3.0.0-alpha] Added
12+
13+
- Added `TestingActual` to initialize multiple tests on `actual` or `spy` param.
14+
- Added `TestingCustom` to include tests on initialization.
15+
- Added `TestingExpectation` class with methods directly accessed by using method names instead of nested structure, but using it through the `TestingExpectTo`.
16+
- Added `expectations` directory with classes where methods are accessed by using nested object structure and method names.
17+
- Added `it` directory with classes with methods are accessed by using nested object structure and method names.
18+
- Added `testing` directory with classes where methods are directly accessed by using method names instead of nested structure, but using it.
19+
- Added `asyncExpect` and jasmine matchers.
20+
21+
### [3.0.0-alpha] Updated
22+
23+
- Updated `Testing` to mixin tests from `testing` directory.
24+
925
## [2.0.0-rc] - 2022-01-30
1026

1127
### [2.0.0-rc] Added

README.md

+52-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Jasmine unit testing wrapper with additional custom testing features.
4141
* [Installation](#installation)
4242
* [Api](#api)
4343
* [Usage](#usage)
44+
* [`Testing`](#testing-class)
45+
* [`TestingActual`](#testingactual)
46+
* [`TestingCustom`](#testingcustom)
4447
* [Features](#features)
4548
* [Expectations](#expectations)
4649
* [Nested](#nested-expectations)
@@ -248,9 +251,9 @@ import {
248251

249252
## Usage
250253

251-
### `Testing`
254+
### `Testing` class
252255

253-
Use `Testing` class for testing.
256+
Main class for testing.
254257

255258
```typescript
256259
import { Testing } from "@angular-package/testing";
@@ -266,6 +269,53 @@ t.describe(`Describe`, () => {
266269
});
267270
```
268271

272+
### `TestingActual`
273+
274+
Class to set `actual` value and use multiple testing `it` methods. It can be used through the `actual()` or `spy()` method of `Testing`.
275+
276+
Example
277+
278+
```typescript
279+
import { TestingActual } from "@angular-package/testing";
280+
281+
const t = new TestingActual();
282+
283+
class ClassA {
284+
public methodA(value?: any) {
285+
return "methodA";
286+
}
287+
288+
public methodB(value?: any) {
289+
return "methodB";
290+
}
291+
}
292+
293+
const classA = new ClassA();
294+
295+
t.describe('TestingActual', () => {
296+
297+
//
298+
t
299+
.actual('a b c d e f g h i j k l m n o p r s')
300+
.toBeString()
301+
.stringIncludes(['f'])
302+
.stringIncludesSome(['f', 'z'])
303+
.stringOfLengthBetween(27, 47)
304+
.toBeStringType()
305+
306+
t
307+
.beforeEach(() => {
308+
spyOn(classA, "methodA");
309+
classA.methodA({test: 27});
310+
})
311+
.spy(() => classA.methodA)
312+
.toHaveBeenCalled()
313+
.toHaveBeenCalledWith({test: 27})
314+
.toHaveBeenCalledTimes(1)
315+
.toHaveBeenCalledOnceWith({test: 27})
316+
});
317+
```
318+
269319
### `TestingCustom`
270320

271321
Use `TestingCustom` class for custom testing. Access to the included tests are through the `testing` getter.

0 commit comments

Comments
 (0)