Commit 83ece07f authored by Wolfram Kriesing's avatar Wolfram Kriesing

Pull code out of test file.

parent 9d808180
// const { fetch } = require('./backend');
const loadStudent = ({ studentId }, dependencies) => {
const cache = dependencies.cache;
const fetch = dependencies.fetch;
if (!cache[studentId]) {
cache[studentId] = fetch({ studentId });
}
return cache[studentId];
};
module.exports = { loadStudent };
const { assertThat, equalTo } = require('hamjest');
// const { fetch } = require('./backend');
const loadStudent = ({ studentId }, dependencies) => {
const cache = dependencies.cache;
const fetch = dependencies.fetch;
if (!cache[studentId]) {
cache[studentId] = fetch({ studentId });
}
return cache[studentId];
};
const { loadStudent } = require('./load-student');
describe('Load a student', () => {
it('from the cache', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment