Skip to content

Commit

Permalink
Feature/jest in core (#899)
Browse files Browse the repository at this point in the history
* WIP

* Replace ava with jest in core

* Update package-lock

* Exclude tests from transpilation

* Expect transformPluginFile to throw

* Mock fetch in audius tests

* Mock fetch in audius tests
nukeop authored Apr 5, 2021
1 parent d78e21e commit f268871
Showing 22 changed files with 4,785 additions and 3,068 deletions.
9 changes: 9 additions & 0 deletions packages/core/__mocks__/electron-store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Electron {
prototype = {}
get() {
return '';
}
set() {}
}

module.exports = Electron;
6 changes: 6 additions & 0 deletions packages/core/__mocks__/electron-timber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class MockLogger {
static log() {}
static error() {}
}

module.exports = MockLogger;
17 changes: 17 additions & 0 deletions packages/core/__mocks__/electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
app: {
getPath: () => { }
},
remote: {
transformSource: () => { },
app: {
getPath: () => { }
},
dialog: {
showOpenDialog: jest.fn(async () => Promise.resolve({
canceled: false,
filePaths: ['test file.txt']
}))
}
}
};
File renamed without changes.
7 changes: 7 additions & 0 deletions packages/core/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

export default async () => ({
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(js|jsx)$': 'ts-jest'
}
});
Loading

0 comments on commit f268871

Please sign in to comment.