This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from brown-ccv/feat-defaults
refactor: 💡 rm unnecess params, add defaults
- Loading branch information
Showing
11 changed files
with
122 additions
and
114 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
coverage | ||
testapp.js | ||
.yarn.lock | ||
.yarn.lock | ||
**/.DS_Store |
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
// add a random number between 0 and offset to the base number | ||
const jitter = (base, offset) => ( | ||
const jitterx = (base, offset) => ( | ||
base + Math.floor(Math.random() * Math.floor(offset)) | ||
) | ||
|
||
// add a random number between 0 and 50 to the base number | ||
const jitter50 = (base) => jitter(base, 50) | ||
|
||
module.exports ={ | ||
jitter, | ||
jitter50 | ||
jitterx | ||
} |
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
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
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,29 @@ | ||
const showImage = require("../trials/showImage.js"); | ||
const { init } = require("../app.js"); | ||
|
||
describe("showImage trial", () => { | ||
it("showImage without photodiode box", () => { | ||
const config = init({ USE_PHOTODIODE: false }); | ||
let data = { code: null }; | ||
const result = showImage(config, "", { | ||
duration: 100, | ||
}); | ||
expect(result.prompt).not.toContain("photodiode-spot"); | ||
expect(result.on_load()).toEqual(undefined); | ||
result.on_finish(data) | ||
expect(data.code).toEqual(1); | ||
}); | ||
|
||
it("showImage with photodiode box and task code", () => { | ||
const config = init({ USE_PHOTODIODE: true }); | ||
let data = { code: null }; | ||
const result = showImage(config, "", { | ||
duration: 100, | ||
taskCode: 10, | ||
}); | ||
expect(result.prompt).toContain("photodiode-spot"); | ||
expect(result.on_load()).toEqual(undefined); | ||
result.on_finish(data) | ||
expect(data.code).toEqual(10); | ||
}); | ||
}); |
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
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
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
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
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.