File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
import { schema as envSchema } from '@poppinss/validator-lite'
11
+ import type { ValidateFn } from '@poppinss/validator-lite/types'
12
+
13
+ import { EnvParser } from './parser.js'
11
14
import { EnvValidator } from './validator.js'
12
15
import { EnvProcessor } from './processor.js'
13
- import { EnvParser } from './parser.js'
14
- import type { ValidateFn } from '@poppinss/validator-lite/types'
15
16
16
17
/**
17
18
* A wrapper over "process.env" with types information.
Original file line number Diff line number Diff line change @@ -62,21 +62,17 @@ test.group('Env', (group) => {
62
62
cleanup,
63
63
fs,
64
64
} ) => {
65
- assert . plan ( 1 )
66
-
67
65
cleanup ( ( ) => {
68
66
Env . removeIdentifier ( 'file' )
69
67
delete process . env . PORT
70
68
} )
71
69
72
70
Env . defineIdentifier ( 'file' , ( _value : string ) => {
73
- assert . isTrue ( true )
74
-
75
71
return '3000'
76
72
} )
77
73
78
74
Env . defineIdentifierIfMissing ( 'file' , ( _value : string ) => {
79
- return '3000 '
75
+ return '4000 '
80
76
} )
81
77
82
78
await fs . create ( '.env' , 'PORT=file:romain' )
Original file line number Diff line number Diff line change @@ -95,21 +95,16 @@ test.group('Env Parser', () => {
95
95
cleanup,
96
96
expectTypeOf,
97
97
} ) => {
98
- assert . plan ( 2 )
99
-
100
98
cleanup ( ( ) => {
101
99
EnvParser . removeIdentifier ( 'file' )
102
100
} )
103
101
104
102
EnvParser . defineIdentifier ( 'file' , ( _value : string ) => {
105
- console . log ( 'Never called' )
106
- assert . isTrue ( true )
107
-
108
103
return '3000'
109
104
} )
110
105
111
106
EnvParser . defineIdentifierIfMissing ( 'file' , ( _value : string ) => {
112
- return '3000 '
107
+ return '4000 '
113
108
} )
114
109
115
110
const envString = [ 'ENV_USER=file:romain' ] . join ( '\n' )
You can’t perform that action at this time.
0 commit comments