File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -88,19 +88,31 @@ import * as engine from '../engine/engine';
8888
8989describe ( 'Angular Builder Integration Tests' , ( ) => {
9090 let context : BuilderContext ;
91+ let originalEnv : NodeJS . ProcessEnv ;
9192
9293 const PROJECT = 'test-project' ;
9394 const BUILD_TARGET : BuildTarget = {
9495 name : `${ PROJECT } :build:production`
9596 } ;
9697
9798 beforeEach ( ( ) => {
99+ // Save and clear CI environment variables to ensure consistent test behavior
100+ originalEnv = { ...process . env } ;
101+ delete process . env . TRAVIS ;
102+ delete process . env . CIRCLECI ;
103+ delete process . env . GITHUB_ACTIONS ;
104+
98105 // Clean up any previous monkeypatch so each test starts fresh
99106 cleanupMonkeypatch ( ) ;
100107 capturedPublishOptions = null ;
101108 context = createMockContext ( ) ;
102109 } ) ;
103110
111+ afterEach ( ( ) => {
112+ // Restore original environment
113+ process . env = originalEnv ;
114+ } ) ;
115+
104116 afterAll ( ( ) => {
105117 // Clean up monkeypatch after all tests
106118 cleanupMonkeypatch ( ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ function runCli(args: string): string {
3434 }
3535
3636 const program = path . resolve ( __dirname , '../dist/angular-cli-ghpages' ) ;
37- return execSync ( `node ${ program } --dry-run ${ args } ` ) . toString ( ) ;
37+ // Clear CI environment variables to ensure consistent test behavior across environments
38+ const env = { ...process . env } ;
39+ delete env . TRAVIS ;
40+ delete env . CIRCLECI ;
41+ delete env . GITHUB_ACTIONS ;
42+
43+ return execSync ( `node ${ program } --dry-run ${ args } ` , { env } ) . toString ( ) ;
3844}
3945
4046function parseJsonFromCliOutput ( output : string ) : DryRunOutput {
You can’t perform that action at this time.
0 commit comments