ava 0.21.0 → 0.25.0

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.
@@ -7,6 +7,9 @@ export type ErrorValidator
7
7
  export interface Observable {
8
8
  subscribe(observer: (value: {}) => void): void;
9
9
  }
10
+ export interface SnapshotOptions {
11
+ id?: string;
12
+ }
10
13
  export type Test = (t: TestContext) => PromiseLike<void> | Iterator<any> | Observable | void;
11
14
  export type GenericTest<T> = (t: GenericTestContext<T>) => PromiseLike<void> | Iterator<any> | Observable | void;
12
15
  export type CallbackTest = (t: CallbackTestContext) => void;
@@ -78,6 +81,7 @@ export interface AssertContext {
78
81
  * Assert that contents matches a snapshot.
79
82
  */
80
83
  snapshot(contents: any, message?: string): void;
84
+ snapshot(contents: any, options: SnapshotOptions, message?: string): void;
81
85
  /**
82
86
  * Assert that contents does not match regex.
83
87
  */
@@ -88,6 +92,10 @@ export interface AssertContext {
88
92
  ifError(error: any, message?: string): void;
89
93
  }
90
94
  export interface TestContext extends AssertContext {
95
+ /**
96
+ * Test title.
97
+ */
98
+ title: string;
91
99
  /**
92
100
  * Plan how many assertion there are in the test.
93
101
  * The test will fail if the actual assertion count doesn't match planned assertions.
@@ -95,6 +103,10 @@ export interface TestContext extends AssertContext {
95
103
  plan(count: number): void;
96
104
 
97
105
  skip: AssertContext;
106
+ /**
107
+ * Log values contextually alongside the test result instead of immediately printing them to `stdout`.
108
+ */
109
+ log(...values: any[]): void;
98
110
  }
99
111
  export interface CallbackTestContext extends TestContext {
100
112
  /**
@@ -1,10 +0,0 @@
1
- 'use strict';
2
- const stackLineRegex = /^.+ \(.+:[0-9]+:[0-9]+\)$/;
3
-
4
- module.exports = stack => {
5
- return stack
6
- .split('\n')
7
- .filter(line => stackLineRegex.test(line))
8
- .map(line => line.trim())
9
- .join('\n');
10
- };