2024-09-23 01:44:59 +00:00
|
|
|
import 'dart:io';
|
2024-09-25 04:04:57 +00:00
|
|
|
import 'package:platform_core/core.dart';
|
2024-09-23 01:44:59 +00:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
2024-09-23 04:39:29 +00:00
|
|
|
test('custom value', () => expect(ProtevusEnvironment('hey').value, 'hey'));
|
2024-09-23 01:44:59 +00:00
|
|
|
|
2024-09-23 04:39:29 +00:00
|
|
|
test('lowercases', () => expect(ProtevusEnvironment('HeY').value, 'hey'));
|
2024-09-23 01:44:59 +00:00
|
|
|
test(
|
|
|
|
'default to env or development',
|
2024-09-23 04:39:29 +00:00
|
|
|
() => expect(ProtevusEnvironment().value,
|
2024-09-23 01:44:59 +00:00
|
|
|
(Platform.environment['ANGEL_ENV'] ?? 'development').toLowerCase()));
|
|
|
|
test('isDevelopment',
|
2024-09-23 04:39:29 +00:00
|
|
|
() => expect(ProtevusEnvironment('development').isDevelopment, true));
|
|
|
|
test('isStaging',
|
|
|
|
() => expect(ProtevusEnvironment('staging').isStaging, true));
|
2024-09-23 01:44:59 +00:00
|
|
|
test('isDevelopment',
|
2024-09-23 04:39:29 +00:00
|
|
|
() => expect(ProtevusEnvironment('production').isProduction, true));
|
2024-09-23 01:44:59 +00:00
|
|
|
}
|