Skip to content

Commit

Permalink
fix: mock torHashedPassword in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkabuki committed Nov 29, 2023
1 parent 335677a commit 4c7387a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ beforeEach(async () => {
],
})
.overrideProvider(TOR_PASSWORD_PROVIDER)
.useValue({ torPassword: '', torHashedPassword: '' })
.useValue({ torPassword: 'b5e447c10b0d99e7871636ee5e0839b5', torHashedPassword: '16:FCFFE21F3D9138906021FAADD9E49703CC41848A95F829E0F6E1BDBE63' })
.compile()

connectionsManagerService = await module.resolve(ConnectionsManagerService)
Expand Down
6 changes: 4 additions & 2 deletions packages/backend/src/nest/tor/tor.service.tor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ describe('TorControl', () => {
let tmpDir: DirResult
let tmpAppDataPath: string

const torPassword = crypto.randomBytes(16).toString('hex')
const torPassword = 'b5e447c10b0d99e7871636ee5e0839b5'
const torHashedPassword = '16:FCFFE21F3D9138906021FAADD9E49703CC41848A95F829E0F6E1BDBE63'


beforeEach(async () => {
jest.clearAllMocks()
Expand All @@ -29,7 +31,7 @@ describe('TorControl', () => {
imports: [TestModule, TorModule],
})
.overrideProvider(TOR_PASSWORD_PROVIDER)
.useValue({ torPassword: torPassword, torHashedPassword: '' })
.useValue({ torPassword, torHashedPassword })
.overrideProvider(TOR_PARAMS_PROVIDER)
.useValue({
torPath: torBinForPlatform(),
Expand Down

0 comments on commit 4c7387a

Please sign in to comment.