Skip to content

Commit

Permalink
WIP: update relative paths in tests directory
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-cronin authored and CMCDragonkai committed Jun 15, 2020
1 parent abff662 commit 3c1c487
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
10 changes: 3 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');

module.exports = {
"roots": [
"<rootDir>/tests"
Expand All @@ -10,9 +8,7 @@ module.exports = {
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
moduleNameMapper: pathsToModuleNameMapper(
compilerOptions.paths,
{ prefix: "<rootDir>/src/" }
)

moduleNameMapper: {
'@polykey/(.*)$': '<rootDir>/src/lib/$1'
}
};
2 changes: 1 addition & 1 deletion src/lib/RPC/RPCMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RPCMessage {
// Load root
const root: Root = new protobuf.Root()
root.resolvePath = (origin, target) => {
return Path.join(__filename, target)
return Path.join(Path.dirname(__filename), target)
}

return root.loadSync(name)
Expand Down
6 changes: 3 additions & 3 deletions tests/Polykey.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ts imports
import fs from 'fs'
import os from 'os'
import Polykey from '../src/lib/Polykey'
import { randomString } from '../src/lib/utils'
import KeyManager from '../src/lib/KeyManager'
import Polykey from '@polykey/Polykey'
import { randomString } from '@polykey/utils'
import KeyManager from '@polykey/KeyManager'

describe('PolyKey class', () => {

Expand Down
6 changes: 3 additions & 3 deletions tests/Vaults.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs'
import os from 'os'
import Polykey from "../src/lib/Polykey"
import { randomString } from '../src/lib/utils'
import KeyManager from '../src/lib/KeyManager'
import Polykey from "@polykey/Polykey"
import { randomString } from '@polykey/utils'
import KeyManager from '@polykey/KeyManager'

describe('vaults', () => {
let vaultName: string
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"allowSyntheticDefaultImports": true,
"module": "CommonJS",
"target": "ES2018",
"baseUrl": "src/lib",
"baseUrl": ".",
"paths": {
"@polykey/*": ["*"],
"@polykey/*": ["src/lib/*"],
}
},
"include": [
Expand Down

0 comments on commit 3c1c487

Please sign in to comment.