@@ -3,7 +3,7 @@ import { parse } from 'yaml';
33import { updateAnthropicModelInYaml } from './yamlConfigUpdater.js' ;
44
55describe ( 'updateAnthropicModelInYaml' , ( ) => {
6- const testApiKey = 'sk -ant-test123456789' ;
6+ const testApiKey = 'TEST -ant-test123456789' ;
77
88 describe ( 'empty or invalid input' , ( ) => {
99 it ( 'should create new config from empty string' , ( ) => {
@@ -13,7 +13,7 @@ describe('updateAnthropicModelInYaml', () => {
1313 expect ( result ) . toContain ( 'version: 1.0.0' ) ;
1414 expect ( result ) . toContain ( 'schema: v1' ) ;
1515 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
16- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
16+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
1717 } ) ;
1818
1919 it ( 'should create new config from invalid YAML' , ( ) => {
@@ -22,7 +22,7 @@ describe('updateAnthropicModelInYaml', () => {
2222
2323 expect ( result ) . toContain ( 'name: Local Config' ) ;
2424 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
25- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
25+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
2626 } ) ;
2727 } ) ;
2828
@@ -36,7 +36,7 @@ schema: v1
3636models:
3737 - uses: openai/gpt-4
3838 with:
39- OPENAI_API_KEY: sk -test
39+ OPENAI_API_KEY: TEST-openai -test
4040` ;
4141
4242 const result = updateAnthropicModelInYaml ( yamlWithComments , testApiKey ) ;
@@ -45,7 +45,7 @@ models:
4545 expect ( result ) . toContain ( '# List of available models' ) ;
4646 expect ( result ) . toContain ( 'uses: openai/gpt-4' ) ;
4747 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
48- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
48+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
4949 } ) ;
5050
5151 it ( 'should preserve comments when updating existing model' , ( ) => {
@@ -65,7 +65,7 @@ models:
6565 expect ( result ) . toContain ( '# My Continue config' ) ;
6666 expect ( result ) . toContain ( '# List of available models' ) ;
6767 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
68- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
68+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
6969 expect ( result ) . not . toContain ( 'old-key' ) ;
7070 } ) ;
7171 } ) ;
@@ -78,15 +78,15 @@ schema: v1
7878models:
7979 - uses: openai/gpt-4
8080 with:
81- OPENAI_API_KEY: sk -openai-test
81+ OPENAI_API_KEY: TEST -openai-test
8282` ;
8383
8484 const result = updateAnthropicModelInYaml ( existingConfig , testApiKey ) ;
8585
8686 expect ( result ) . toContain ( 'uses: openai/gpt-4' ) ;
8787 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
88- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
89- expect ( result ) . toContain ( 'OPENAI_API_KEY: sk -openai-test' ) ;
88+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
89+ expect ( result ) . toContain ( 'OPENAI_API_KEY: TEST -openai-test' ) ;
9090 } ) ;
9191
9292 it ( 'should update existing anthropic model' , ( ) => {
@@ -99,15 +99,15 @@ models:
9999 ANTHROPIC_API_KEY: old-anthropic-key
100100 - uses: openai/gpt-4
101101 with:
102- OPENAI_API_KEY: sk -openai-test
102+ OPENAI_API_KEY: TEST -openai-test
103103` ;
104104
105105 const result = updateAnthropicModelInYaml ( existingConfig , testApiKey ) ;
106106
107107 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
108108 expect ( result ) . toContain ( 'uses: openai/gpt-4' ) ;
109- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
110- expect ( result ) . toContain ( 'OPENAI_API_KEY: sk -openai-test' ) ;
109+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
110+ expect ( result ) . toContain ( 'OPENAI_API_KEY: TEST -openai-test' ) ;
111111 expect ( result ) . not . toContain ( 'old-anthropic-key' ) ;
112112
113113 // Should only have one anthropic model
@@ -126,7 +126,7 @@ schema: v1
126126 expect ( result ) . toContain ( 'name: Local Config' ) ;
127127 expect ( result ) . toContain ( 'models:' ) ;
128128 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
129- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
129+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
130130 } ) ;
131131
132132 it ( 'should handle config with empty models array' , ( ) => {
@@ -140,7 +140,7 @@ models: []
140140
141141 expect ( result ) . toContain ( 'name: Local Config' ) ;
142142 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
143- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
143+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
144144 } ) ;
145145 } ) ;
146146
@@ -182,14 +182,14 @@ models: "not an array"
182182 const result = updateAnthropicModelInYaml ( malformedConfig , testApiKey ) ;
183183
184184 expect ( result ) . toContain ( 'uses: anthropic/claude-4-sonnet' ) ;
185- expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: sk -ant-test123456789' ) ;
185+ expect ( result ) . toContain ( 'ANTHROPIC_API_KEY: TEST -ant-test123456789' ) ;
186186 } ) ;
187187
188188 it ( 'should handle different API key formats' , ( ) => {
189189 const differentKeys = [
190- 'sk -ant-1234567890' ,
191- 'sk -ant-abcdefghijklmnop' ,
192- 'sk -ant-test-key-with-dashes'
190+ 'TEST -ant-1234567890' ,
191+ 'TEST -ant-abcdefghijklmnop' ,
192+ 'TEST -ant-test-key-with-dashes'
193193 ] ;
194194
195195 differentKeys . forEach ( key => {
0 commit comments