You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch introduces a small quality of life improvement, which I felt was particularly necessary after introducing class-based testing:
15
+
16
+
**Multiline Test Cases!**
17
+
18
+
19
+
```js
20
+
/**
21
+
* @test 'Jesse', 24
22
+
* ~> $.grow(3)
23
+
* ~> $.grow(2) returns 29
24
+
*
25
+
* @test 'Rick', 62
26
+
* ~> $.grow(1) returns 63
27
+
* ~> $.grow(2) returns 65
28
+
* ~> $.getName() returns 'Rick'
29
+
* ~> $.grow() returns $.age === 66
30
+
*/
31
+
exportclassPerson {
32
+
constructor(name, age) {
33
+
this.name= name
34
+
this.age= age
35
+
}
36
+
37
+
grow(amount=1) {
38
+
returnthis.age+= amount
39
+
}
40
+
41
+
getName() {
42
+
returnthis.name
43
+
}
44
+
}
45
+
```
46
+
47
+
If you write a test case on multiple lines, Pineapple will now automatically concatenate it to the test case. This is not exclusive to class / higher-order function syntax.
48
+
49
+
50
+
```js
51
+
/**
52
+
* @test {
53
+
* tenant: 'Rick',
54
+
* length: 10,
55
+
* type: 'boat'
56
+
* } resolves
57
+
*
58
+
* @test {
59
+
* tenant: 10,
60
+
* length: 'Rick',
61
+
* type: 'boat'
62
+
* } rejects
63
+
*/
64
+
exportasyncfunctioncreateLease({ tenant, length, type ='boat' }) {
65
+
if (typeof tenant !=='string'||typeof length !=='number')
0 commit comments