File tree 3 files changed +27
-0
lines changed
3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 10
10
"exports" : {
11
11
"./bigint" : " ./dist/src/bigint.js" ,
12
12
"./bytes" : " ./dist/src/bytes.js" ,
13
+ "./ci" : " ./dist/src/ci.js" ,
13
14
"./common-errors" : " ./dist/src/common-errors.js" ,
14
15
"./crypto" : " ./dist/src/crypto.js" ,
15
16
"./date" : " ./dist/src/date.js" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Returns 'true' if the current process is running in the GitHub CI environment.
3
+ */
4
+ export function isCI ( ) {
5
+ return process . env . CI === "true" ;
6
+ }
Original file line number Diff line number Diff line change
1
+ import assert from "node:assert/strict" ;
2
+ import { describe , it } from "node:test" ;
3
+
4
+ import { isCI } from "../src/ci.js" ;
5
+
6
+ describe ( "ci" , ( ) => {
7
+ it ( "should be true because the ENV variable CI is true" , async function ( ) {
8
+ process . env . CI = "true" ;
9
+ assert . equal ( isCI ( ) , true ) ;
10
+ } ) ;
11
+
12
+ it ( "should be false because the ENV variable CI is false" , async function ( ) {
13
+ process . env . CI = "false" ;
14
+ assert . equal ( isCI ( ) , false ) ;
15
+ } ) ;
16
+
17
+ it ( "should be false because the ENV variable CI is undefined" , async function ( ) {
18
+ assert . equal ( isCI ( ) , false ) ;
19
+ } ) ;
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments