@@ -2,12 +2,13 @@ package ffexporter_test
2
2
3
3
import (
4
4
"context"
5
- "github.com/stretchr/testify/assert"
6
5
"io/ioutil"
7
6
"log"
8
7
"os"
9
8
"testing"
10
9
10
+ "github.com/stretchr/testify/assert"
11
+
11
12
"github.com/thomaspoignant/go-feature-flag/ffexporter"
12
13
)
13
14
@@ -40,10 +41,14 @@ func TestFile_Export(t *testing.T) {
40
41
fields : fields {},
41
42
args : args {
42
43
featureEvents : []ffexporter.FeatureEvent {
43
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
44
- Variation : "Default" , Value : "YO" , Default : false },
45
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
46
- Variation : "Default" , Value : "YO2" , Default : false , Version : 127 },
44
+ {
45
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
46
+ Variation : "Default" , Value : "YO" , Default : false ,
47
+ },
48
+ {
49
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
50
+ Variation : "Default" , Value : "YO2" , Default : false , Version : 127 ,
51
+ },
47
52
},
48
53
},
49
54
expected : expected {
@@ -59,10 +64,14 @@ func TestFile_Export(t *testing.T) {
59
64
},
60
65
args : args {
61
66
featureEvents : []ffexporter.FeatureEvent {
62
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
63
- Variation : "Default" , Value : "YO" , Default : false },
64
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
65
- Variation : "Default" , Value : "YO2" , Default : false },
67
+ {
68
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
69
+ Variation : "Default" , Value : "YO" , Default : false ,
70
+ },
71
+ {
72
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
73
+ Variation : "Default" , Value : "YO2" , Default : false ,
74
+ },
66
75
},
67
76
},
68
77
expected : expected {
@@ -79,10 +88,14 @@ func TestFile_Export(t *testing.T) {
79
88
},
80
89
args : args {
81
90
featureEvents : []ffexporter.FeatureEvent {
82
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
83
- Variation : "Default" , Value : "YO" , Default : false },
84
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
85
- Variation : "Default" , Value : "YO2" , Default : false },
91
+ {
92
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
93
+ Variation : "Default" , Value : "YO" , Default : false ,
94
+ },
95
+ {
96
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
97
+ Variation : "Default" , Value : "YO2" , Default : false ,
98
+ },
86
99
},
87
100
},
88
101
expected : expected {
@@ -99,10 +112,14 @@ func TestFile_Export(t *testing.T) {
99
112
},
100
113
args : args {
101
114
featureEvents : []ffexporter.FeatureEvent {
102
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
103
- Variation : "Default" , Value : "YO" , Default : false },
104
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
105
- Variation : "Default" , Value : "YO2" , Default : false },
115
+ {
116
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
117
+ Variation : "Default" , Value : "YO" , Default : false ,
118
+ },
119
+ {
120
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
121
+ Variation : "Default" , Value : "YO2" , Default : false ,
122
+ },
106
123
},
107
124
},
108
125
expected : expected {
@@ -118,10 +135,14 @@ func TestFile_Export(t *testing.T) {
118
135
},
119
136
args : args {
120
137
featureEvents : []ffexporter.FeatureEvent {
121
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
122
- Variation : "Default" , Value : "YO" , Default : false },
123
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
124
- Variation : "Default" , Value : "YO2" , Default : false , Version : 127 },
138
+ {
139
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
140
+ Variation : "Default" , Value : "YO" , Default : false ,
141
+ },
142
+ {
143
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
144
+ Variation : "Default" , Value : "YO2" , Default : false , Version : 127 ,
145
+ },
125
146
},
126
147
},
127
148
expected : expected {
@@ -137,10 +158,14 @@ func TestFile_Export(t *testing.T) {
137
158
},
138
159
args : args {
139
160
featureEvents : []ffexporter.FeatureEvent {
140
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
141
- Variation : "Default" , Value : "YO" , Default : false },
142
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
143
- Variation : "Default" , Value : "YO2" , Default : false },
161
+ {
162
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
163
+ Variation : "Default" , Value : "YO" , Default : false ,
164
+ },
165
+ {
166
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
167
+ Variation : "Default" , Value : "YO2" , Default : false ,
168
+ },
144
169
},
145
170
},
146
171
},
@@ -152,10 +177,14 @@ func TestFile_Export(t *testing.T) {
152
177
},
153
178
args : args {
154
179
featureEvents : []ffexporter.FeatureEvent {
155
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
156
- Variation : "Default" , Value : "YO" , Default : false },
157
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
158
- Variation : "Default" , Value : "YO2" , Default : false },
180
+ {
181
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
182
+ Variation : "Default" , Value : "YO" , Default : false ,
183
+ },
184
+ {
185
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
186
+ Variation : "Default" , Value : "YO2" , Default : false ,
187
+ },
159
188
},
160
189
},
161
190
},
@@ -168,10 +197,14 @@ func TestFile_Export(t *testing.T) {
168
197
},
169
198
args : args {
170
199
featureEvents : []ffexporter.FeatureEvent {
171
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
172
- Variation : "Default" , Value : "YO" , Default : false },
173
- {Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
174
- Variation : "Default" , Value : "YO2" , Default : false },
200
+ {
201
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "ABCD" , CreationDate : 1617970547 , Key : "random-key" ,
202
+ Variation : "Default" , Value : "YO" , Default : false ,
203
+ },
204
+ {
205
+ Kind : "feature" , ContextKind : "anonymousUser" , UserKey : "EFGH" , CreationDate : 1617970701 , Key : "random-key" ,
206
+ Variation : "Default" , Value : "YO2" , Default : false ,
207
+ },
175
208
},
176
209
},
177
210
},
0 commit comments