@ngxs/store 19.0.0-dev.master-81c7a7c → 19.0.0-dev.master-d7a9638
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Store, NgxsModuleOptions } from '@ngxs/store';
|
|
2
|
-
import
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ModuleWithProviders, EnvironmentProviders } from '@angular/core';
|
|
3
4
|
import { TestBedStatic } from '@angular/core/testing';
|
|
4
5
|
import { ɵStateClass as _StateClass } from '@ngxs/store/internals';
|
|
5
6
|
|
|
@@ -28,4 +29,45 @@ type ConsoleRecorder = ConsoleRecord[];
|
|
|
28
29
|
declare function loggedError(message: string): ConsoleRecord;
|
|
29
30
|
declare function skipConsoleLogging<T extends (...args: any[]) => any>(fn: T, consoleRecorder?: ConsoleRecorder): ReturnType<T>;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
declare class NgxsActionCollector {
|
|
33
|
+
/**
|
|
34
|
+
* Including this in your providers will
|
|
35
|
+
* set up the the action collector to start collecting actions
|
|
36
|
+
* from before NGXS initializes
|
|
37
|
+
* @example
|
|
38
|
+
* // In your providers declaration for your tests:
|
|
39
|
+
* {
|
|
40
|
+
* providers: [
|
|
41
|
+
* NgxsActionCollector.collectActions(),
|
|
42
|
+
* provideStore([MyState], { executionStrategy: ... }),
|
|
43
|
+
* ],
|
|
44
|
+
* // ...
|
|
45
|
+
* }
|
|
46
|
+
* // and then in your test:
|
|
47
|
+
* const actionCollector = TestBed.inject(NgxsActionCollector);
|
|
48
|
+
* const actionsDispatched = actionCollector.dispatched;
|
|
49
|
+
* const action = actionsDispatched.find(
|
|
50
|
+
* (item) => item instanceof MyAction
|
|
51
|
+
* );
|
|
52
|
+
* expect(action).toBeDefined();
|
|
53
|
+
* @returns An environment initializer that starts the collector immediately
|
|
54
|
+
*/
|
|
55
|
+
static collectActions(): EnvironmentProviders;
|
|
56
|
+
private _destroyed$;
|
|
57
|
+
private _stopped$;
|
|
58
|
+
private _started;
|
|
59
|
+
readonly dispatched: any[];
|
|
60
|
+
readonly completed: any[];
|
|
61
|
+
readonly successful: any[];
|
|
62
|
+
readonly errored: any[];
|
|
63
|
+
readonly cancelled: any[];
|
|
64
|
+
private _actions$;
|
|
65
|
+
constructor();
|
|
66
|
+
start(): void;
|
|
67
|
+
reset(): void;
|
|
68
|
+
stop(): void;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsActionCollector, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxsActionCollector>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { type ConsoleRecord, type ConsoleRecorder, NgxsActionCollector, NgxsTestBed, type NgxsTesting, freshPlatform, loggedError, skipConsoleLogging };
|