Skip to content

Commit

Permalink
Add more sound function exports, and extend list library to all at or…
Browse files Browse the repository at this point in the history
… above Source chapter 2 (#31)

* Add only safe test for sound grader + add sound library

* Add more functions needed for future sound mission tests, remove missing timeout_duration constant

* Update script to include sound folder

* Moved list.js higher, add list.js as a condition on source chapter number instead, update sound library exports

* Add list.js to build script

* Remove chapter check, moved util.js up to reflect dependency levels of library files

* Removed commented out lines and removed unused tone matrix
  • Loading branch information
KnightNiwrem authored and remo5000 committed Sep 14, 2018
1 parent d7e1f9b commit 2b4617a
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 601 deletions.
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ fi

yarn install --production=true
tsc
cd build && zip -r --exclude=*terraform* ../grader.zip index.js util.js graphics/ sound/ && cd ..
cd build && zip -r --exclude=*terraform* ../grader.zip index.js util.js list.js graphics/ sound/ && cd ..
zip -ur grader.zip node_modules/
yarn install --production=false
2 changes: 2 additions & 0 deletions src/__tests__/test_sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const makeAwsEvent = awsEventFactory({
'get_duration',
'get_wave',
'is_sound',
'letter_name_to_midi_note',
'make_sourcesound',
'midi_note_to_frequency',
'noise',
'play',
'sawtooth_sound',
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type TimeoutResult = {
}

export const runAll = async (event: AwsEvent): Promise<Output[]> => {
require('./util.js')
require('./list.js')
if (event.library && event.library.external) {
switch(event.library.external.name) {
case 'TWO_DIM_RUNES': {}
Expand All @@ -78,7 +80,6 @@ export const runAll = async (event: AwsEvent): Promise<Output[]> => {
}
}
}
require('./util.js')
evaluateGlobals(event.library.globals)
const stdPrg = event.studentProgram
const promises = event.graderPrograms.map(
Expand Down
Loading

0 comments on commit 2b4617a

Please sign in to comment.