-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flag disable classifier filter (#80)
* created route to get samples * modify API response for samples to include auto
- Loading branch information
Anugerah Erlaut
authored
Apr 1, 2021
1 parent
9ae4719
commit 91eee58
Showing
10 changed files
with
257 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const mockGetSamples = jest.fn(() => new Promise((resolve) => { | ||
resolve({ | ||
samples: { | ||
ids: ['sample-1'], | ||
'sample-1': { | ||
name: 'sample-1', | ||
}, | ||
}, | ||
}); | ||
})); | ||
|
||
const mockGetSampleIds = jest.fn(() => new Promise((resolve) => { | ||
resolve({ | ||
samples: { | ||
ids: ['sample-1', 'sample-2'], | ||
}, | ||
}); | ||
})); | ||
|
||
const mock = jest.fn().mockImplementation(() => ({ | ||
getSamples: mockGetSamples, | ||
getSampleIds: mockGetSampleIds, | ||
})); | ||
|
||
module.exports = mock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const SamplesService = require('../route-services/samples'); | ||
|
||
const samplesService = new SamplesService(); | ||
|
||
module.exports = { | ||
'samples#get': (req, res, next) => { | ||
samplesService.getSamples(req.params.experimentId) | ||
.then((data) => res.json(data)) | ||
.catch(next); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.