Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 6f933ce

Browse files
committed
Fixed licensing info and remove a few unrelated unit tests
1 parent a640d79 commit 6f933ce

File tree

4 files changed

+4
-165
lines changed

4 files changed

+4
-165
lines changed

packages/optimizely-sdk/lib/index.react_native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2017, 2019, Optimizely
2+
* Copyright 2019, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

packages/optimizely-sdk/lib/index.react_native.tests.js

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2019, Optimizely
2+
* Copyright 2019, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -131,167 +131,6 @@ describe('javascript-sdk/react-native', function() {
131131
assert.strictEqual(activate, 'control');
132132
});
133133

134-
it('should be able to set and get a forced variation', function() {
135-
var optlyInstance = optimizelyFactory.createInstance({
136-
datafile: testData.getTestProjectConfig(),
137-
errorHandler: fakeErrorHandler,
138-
eventDispatcher: optimizelyFactory.eventDispatcher,
139-
logger: silentLogger,
140-
});
141-
142-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
143-
assert.strictEqual(didSetVariation, true);
144-
145-
var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser');
146-
assert.strictEqual(variation, 'control');
147-
});
148-
149-
it('should be able to set and unset a forced variation', function() {
150-
var optlyInstance = optimizelyFactory.createInstance({
151-
datafile: testData.getTestProjectConfig(),
152-
errorHandler: fakeErrorHandler,
153-
eventDispatcher: optimizelyFactory.eventDispatcher,
154-
logger: silentLogger,
155-
});
156-
157-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
158-
assert.strictEqual(didSetVariation, true);
159-
160-
var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser');
161-
assert.strictEqual(variation, 'control');
162-
163-
var didSetVariation2 = optlyInstance.setForcedVariation('testExperiment', 'testUser', null);
164-
assert.strictEqual(didSetVariation2, true);
165-
166-
var variation2 = optlyInstance.getForcedVariation('testExperiment', 'testUser');
167-
assert.strictEqual(variation2, null);
168-
});
169-
170-
it('should be able to set multiple experiments for one user', function() {
171-
var optlyInstance = optimizelyFactory.createInstance({
172-
datafile: testData.getTestProjectConfig(),
173-
errorHandler: fakeErrorHandler,
174-
eventDispatcher: optimizelyFactory.eventDispatcher,
175-
logger: silentLogger,
176-
});
177-
178-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
179-
assert.strictEqual(didSetVariation, true);
180-
181-
var didSetVariation2 = optlyInstance.setForcedVariation(
182-
'testExperimentLaunched',
183-
'testUser',
184-
'controlLaunched'
185-
);
186-
assert.strictEqual(didSetVariation2, true);
187-
188-
var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser');
189-
assert.strictEqual(variation, 'control');
190-
191-
var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser');
192-
assert.strictEqual(variation2, 'controlLaunched');
193-
});
194-
195-
it('should be able to set multiple experiments for one user, and unset one', function() {
196-
var optlyInstance = optimizelyFactory.createInstance({
197-
datafile: testData.getTestProjectConfig(),
198-
errorHandler: fakeErrorHandler,
199-
eventDispatcher: optimizelyFactory.eventDispatcher,
200-
logger: silentLogger,
201-
});
202-
203-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
204-
assert.strictEqual(didSetVariation, true);
205-
206-
var didSetVariation2 = optlyInstance.setForcedVariation(
207-
'testExperimentLaunched',
208-
'testUser',
209-
'controlLaunched'
210-
);
211-
assert.strictEqual(didSetVariation2, true);
212-
213-
var didSetVariation2 = optlyInstance.setForcedVariation('testExperimentLaunched', 'testUser', null);
214-
assert.strictEqual(didSetVariation2, true);
215-
216-
var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser');
217-
assert.strictEqual(variation, 'control');
218-
219-
var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser');
220-
assert.strictEqual(variation2, null);
221-
});
222-
223-
it('should be able to set multiple experiments for one user, and reset one', function() {
224-
var optlyInstance = optimizelyFactory.createInstance({
225-
datafile: testData.getTestProjectConfig(),
226-
errorHandler: fakeErrorHandler,
227-
eventDispatcher: optimizelyFactory.eventDispatcher,
228-
logger: silentLogger,
229-
});
230-
231-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
232-
assert.strictEqual(didSetVariation, true);
233-
234-
var didSetVariation2 = optlyInstance.setForcedVariation(
235-
'testExperimentLaunched',
236-
'testUser',
237-
'controlLaunched'
238-
);
239-
assert.strictEqual(didSetVariation2, true);
240-
241-
var didSetVariation2 = optlyInstance.setForcedVariation(
242-
'testExperimentLaunched',
243-
'testUser',
244-
'variationLaunched'
245-
);
246-
assert.strictEqual(didSetVariation2, true);
247-
248-
var variation = optlyInstance.getForcedVariation('testExperiment', 'testUser');
249-
assert.strictEqual(variation, 'control');
250-
251-
var variation2 = optlyInstance.getForcedVariation('testExperimentLaunched', 'testUser');
252-
assert.strictEqual(variation2, 'variationLaunched');
253-
});
254-
255-
it('should override bucketing when setForcedVariation is called', function() {
256-
var optlyInstance = optimizelyFactory.createInstance({
257-
datafile: testData.getTestProjectConfig(),
258-
errorHandler: fakeErrorHandler,
259-
eventDispatcher: optimizelyFactory.eventDispatcher,
260-
logger: silentLogger,
261-
});
262-
263-
var didSetVariation = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'control');
264-
assert.strictEqual(didSetVariation, true);
265-
266-
var variation = optlyInstance.getVariation('testExperiment', 'testUser');
267-
assert.strictEqual(variation, 'control');
268-
269-
var didSetVariation2 = optlyInstance.setForcedVariation('testExperiment', 'testUser', 'variation');
270-
assert.strictEqual(didSetVariation2, true);
271-
272-
var variation = optlyInstance.getVariation('testExperiment', 'testUser');
273-
assert.strictEqual(variation, 'variation');
274-
});
275-
276-
it('should override bucketing when setForcedVariation is called for a not running experiment', function() {
277-
var optlyInstance = optimizelyFactory.createInstance({
278-
datafile: testData.getTestProjectConfig(),
279-
errorHandler: fakeErrorHandler,
280-
eventDispatcher: optimizelyFactory.eventDispatcher,
281-
logger: silentLogger,
282-
});
283-
284-
var didSetVariation = optlyInstance.setForcedVariation(
285-
'testExperimentNotRunning',
286-
'testUser',
287-
'controlNotRunning'
288-
);
289-
assert.strictEqual(didSetVariation, true);
290-
291-
var variation = optlyInstance.getVariation('testExperimentNotRunning', 'testUser');
292-
assert.strictEqual(variation, null);
293-
});
294-
295134
describe('when passing in logLevel', function() {
296135
beforeEach(function() {
297136
sinon.stub(logging, 'setLogLevel');

packages/optimizely-sdk/lib/plugins/logger/index.react_native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2017, Optimizely
2+
* Copyright 2019, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

packages/optimizely-sdk/lib/plugins/logger/index.react_native.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016, Optimizely
2+
* Copyright 2019, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)