Skip to content

Commit 29256c0

Browse files
committed
Merge HMD env tests
1 parent 3b3e7a1 commit 29256c0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/config.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,19 @@ describe('Config test', function () {
4545
.to.throw(/Please specify CodiMD server URL either/)
4646
})
4747

48-
it('should set enterprise to true if HMD_CLI_COOKIE_PATH is supplied', function () {
49-
process.env.HMD_CLI_COOKIE_PATH = tempDir()
48+
it('should set enterprise to true if HMD_CLI_COOKIE_PATH or HMD_CLI_SERVER_URL are supplied', function () {
5049
fs.writeFileSync(this.configFilePath, '{}', 'utf8')
5150

52-
const config = requireConfig()
51+
process.env.HMD_CLI_COOKIE_PATH = tempDir()
52+
let config = requireConfig()
5353

5454
expect(config.cookiePath).to.eq(process.env.HMD_CLI_COOKIE_PATH)
5555
expect(config.enterprise).to.eq(true)
56-
})
5756

58-
it('should set enterprise to true if HMD_CLI_SERVER_URL is supplied', function () {
59-
process.env.HMD_CLI_SERVER_URL = tempDir()
60-
fs.writeFileSync(this.configFilePath, '{}', 'utf8')
57+
cleanup()
6158

62-
const config = requireConfig()
59+
process.env.HMD_CLI_SERVER_URL = tempDir()
60+
config = requireConfig()
6361

6462
expect(config.serverUrl).to.eq(process.env.HMD_CLI_SERVER_URL)
6563
expect(config.enterprise).to.eq(true)

0 commit comments

Comments
 (0)