File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const version = pkg.version || "development"
23
23
export const commit = pkg . commit || "development"
24
24
export const rootPath = path . resolve ( __dirname , "../.." )
25
25
export const vsRootPath = path . join ( rootPath , "vendor/modules/code-oss-dev" )
26
- export const codeVersion = require ( path . join ( vsRootPath , "package.json" ) ) . version
26
+ export const codeVersion = require ( path . join ( vsRootPath , "package.json" ) ) . version || "development"
27
27
export const tmpdir = path . join ( os . tmpdir ( ) , "code-server" )
28
28
export const isDevMode = commit === "development"
29
29
export const httpProxyUri =
Original file line number Diff line number Diff line change @@ -119,5 +119,18 @@ describe("constants", () => {
119
119
it ( "commit should return 'development'" , ( ) => {
120
120
expect ( constants . commit ) . toBe ( "development" )
121
121
} )
122
+
123
+ it ( "should return a human-readable version string" , ( ) => {
124
+ // this string is not super useful
125
+ expect ( constants . getVersionString ( ) ) . toStrictEqual ( "development development" )
126
+ } )
127
+
128
+ it ( "should return a machine-readable version string" , ( ) => {
129
+ expect ( constants . getVersionJsonString ( ) ) . toStrictEqual ( JSON . stringify ( {
130
+ codeServer : "development" ,
131
+ commit : "development" ,
132
+ vscode : "development" ,
133
+ } ) )
134
+ } )
122
135
} )
123
136
} )
You can’t perform that action at this time.
0 commit comments