21 lines
489 B
TypeScript
21 lines
489 B
TypeScript
import { expect } from 'chai';
|
|
import 'mocha';
|
|
import { isDev } from './env';
|
|
|
|
export function setDev(dev = true): void {
|
|
if (dev) {
|
|
process.argv.splice(2, 0, '--env=dev');
|
|
} else {
|
|
process.argv = process.argv.filter((value) => value !== '--env=dev');
|
|
}
|
|
}
|
|
|
|
describe('Environment Service', () => {
|
|
it('correctly identifies the development process argument', () => {
|
|
setDev();
|
|
expect(isDev()).to.be.true;
|
|
setDev(false);
|
|
expect(isDev()).to.be.false;
|
|
});
|
|
});
|