Add "_test" suffix to environment test file
This commit is contained in:
parent
ecb76b64a3
commit
f157ce2eec
1 changed files with 0 additions and 0 deletions
41
ts/test-both/environment_test.ts
Normal file
41
ts/test-both/environment_test.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { parseEnvironment, Environment } from '../environment';
|
||||
|
||||
describe('environment utilities', () => {
|
||||
describe('parseEnvironment', () => {
|
||||
it('returns Environment.Production for non-strings', () => {
|
||||
assert.equal(parseEnvironment(undefined), Environment.Production);
|
||||
assert.equal(parseEnvironment(0), Environment.Production);
|
||||
});
|
||||
|
||||
it('returns Environment.Production for invalid strings', () => {
|
||||
assert.equal(parseEnvironment(''), Environment.Production);
|
||||
assert.equal(parseEnvironment(' development '), Environment.Production);
|
||||
assert.equal(parseEnvironment('PRODUCTION'), Environment.Production);
|
||||
});
|
||||
|
||||
it('parses "development" as Environment.Development', () => {
|
||||
assert.equal(parseEnvironment('development'), Environment.Development);
|
||||
});
|
||||
|
||||
it('parses "production" as Environment.Production', () => {
|
||||
assert.equal(parseEnvironment('production'), Environment.Production);
|
||||
});
|
||||
|
||||
it('parses "staging" as Environment.Staging', () => {
|
||||
assert.equal(parseEnvironment('staging'), Environment.Staging);
|
||||
});
|
||||
|
||||
it('parses "test" as Environment.Test', () => {
|
||||
assert.equal(parseEnvironment('test'), Environment.Test);
|
||||
});
|
||||
|
||||
it('parses "test-lib" as Environment.TestLib', () => {
|
||||
assert.equal(parseEnvironment('test-lib'), Environment.TestLib);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue