diff --git a/.mocharc.json b/.mocharc.json index 88fc65e..893a259 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -2,6 +2,6 @@ "require": [ "@babel/register", "ts-node/register", - "./src/test/bootstrap.js" + "./test/bootstrap.js" ] } diff --git a/package.json b/package.json index ed7a900..2a69506 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "webpack:build": "webpack --mode production", "ts:build": "tsc -p tsconfig.json", "ts:watch": "tsc --watch", - "test": "cross-env mocha -r ts-node/register -r esm \"src/test/**/*.spec.js\"", + "test": "cross-env mocha -r ts-node/register -r esm \"test/**/*.spec.js\"", "coverage": "cross-env NODE_ENV=test nyc npm run test -- --reporter landing --cache", "report": "nyc report --root coverage --format html", "docs": "typedoc", diff --git a/src/test/Helpers.js b/test/Helpers.js similarity index 100% rename from src/test/Helpers.js rename to test/Helpers.js diff --git a/src/test/bootstrap.js b/test/bootstrap.js similarity index 100% rename from src/test/bootstrap.js rename to test/bootstrap.js diff --git a/src/test/notation/measure.spec.js b/test/notation/measure.spec.js similarity index 98% rename from src/test/notation/measure.spec.js rename to test/notation/measure.spec.js index 5bf4ccb..c55842d 100644 --- a/src/test/notation/measure.spec.js +++ b/test/notation/measure.spec.js @@ -1,5 +1,5 @@ -import Measure from '../../notation/Measure' -import { InvalidInput } from '../../Exceptions' +import Measure from '../../src/notation/Measure' +import { InvalidInput } from '../../src/Exceptions' describe('Measure', () => { diff --git a/src/test/notation/score-handler.spec.js b/test/notation/score-handler.spec.js similarity index 98% rename from src/test/notation/score-handler.spec.js rename to test/notation/score-handler.spec.js index b4eb756..992099e 100644 --- a/src/test/notation/score-handler.spec.js +++ b/test/notation/score-handler.spec.js @@ -1,4 +1,4 @@ -import { Measure, Score, ScoreHandler } from '../..' +import { Measure, Score, ScoreHandler } from '../../src' describe('Score Handler', () => { let score, measure, chordMeasure diff --git a/src/test/notation/score.spec.js b/test/notation/score.spec.js similarity index 99% rename from src/test/notation/score.spec.js rename to test/notation/score.spec.js index cdc4e5a..2667c04 100644 --- a/src/test/notation/score.spec.js +++ b/test/notation/score.spec.js @@ -1,4 +1,4 @@ -import { Measure, Score } from '../..' +import { Measure, Score } from '../../src' describe('Score', () => { let score diff --git a/src/test/theory/chord.spec.js b/test/theory/chord.spec.js similarity index 83% rename from src/test/theory/chord.spec.js rename to test/theory/chord.spec.js index 53b9095..d05c2c6 100644 --- a/src/test/theory/chord.spec.js +++ b/test/theory/chord.spec.js @@ -1,5 +1,5 @@ -import { Chord, PitchClass } from '../..' -import { InvalidInput } from '../../Exceptions' +import { Chord, PitchClass } from '../../src' +import { InvalidInput } from '../../src/Exceptions' const c = new PitchClass('c') diff --git a/src/test/theory/guitar-chord-pattern.spec.js b/test/theory/guitar-chord-pattern.spec.js similarity index 93% rename from src/test/theory/guitar-chord-pattern.spec.js rename to test/theory/guitar-chord-pattern.spec.js index c3eef43..014b741 100644 --- a/src/test/theory/guitar-chord-pattern.spec.js +++ b/test/theory/guitar-chord-pattern.spec.js @@ -1,4 +1,4 @@ -import { GuitarChordPattern, PitchClass } from '../..' +import { GuitarChordPattern, PitchClass } from '../../src' describe('Guitar Chord Pattern', () => { let c, g, gcp diff --git a/src/test/theory/musical-pattern.spec.js b/test/theory/musical-pattern.spec.js similarity index 95% rename from src/test/theory/musical-pattern.spec.js rename to test/theory/musical-pattern.spec.js index 5bb5fa9..b4f0032 100644 --- a/src/test/theory/musical-pattern.spec.js +++ b/test/theory/musical-pattern.spec.js @@ -1,4 +1,4 @@ -import { MusicalPattern, PitchClass } from '../../' +import { MusicalPattern, PitchClass } from '../../src' describe('Musical Pattern', () => { describe('#constructor', () => { diff --git a/src/test/theory/note.spec.js b/test/theory/note.spec.js similarity index 95% rename from src/test/theory/note.spec.js rename to test/theory/note.spec.js index b112b4d..3b5b56b 100644 --- a/src/test/theory/note.spec.js +++ b/test/theory/note.spec.js @@ -1,5 +1,5 @@ -import { Note } from '../../' -import { InvalidInput } from '../../Exceptions' +import { Note } from '../../src' +import { InvalidInput } from '../../src/Exceptions' import { testIntervals } from '../Helpers' let c diff --git a/src/test/theory/pitch-class.spec.js b/test/theory/pitch-class.spec.js similarity index 98% rename from src/test/theory/pitch-class.spec.js rename to test/theory/pitch-class.spec.js index 3b67d33..0991cb0 100644 --- a/src/test/theory/pitch-class.spec.js +++ b/test/theory/pitch-class.spec.js @@ -1,5 +1,5 @@ -import { PitchClass } from '../../' -import { InvalidInput } from '../../Exceptions' +import { PitchClass } from '../../src' +import { InvalidInput } from '../../src/Exceptions' import { testIntervals } from '../Helpers' describe('PitchClass', () => { diff --git a/src/test/theory/scale.spec.js b/test/theory/scale.spec.js similarity index 98% rename from src/test/theory/scale.spec.js rename to test/theory/scale.spec.js index 458d6fa..15b599f 100644 --- a/src/test/theory/scale.spec.js +++ b/test/theory/scale.spec.js @@ -1,4 +1,4 @@ -import { Chord, PitchClass, Scale } from '../../' +import { Chord, PitchClass, Scale } from '../../src/' describe('Scale', () => { diff --git a/src/test/utilities/general-functions.spec.js b/test/utilities/general-functions.spec.js similarity index 98% rename from src/test/utilities/general-functions.spec.js rename to test/utilities/general-functions.spec.js index 99b934c..dba1f74 100644 --- a/src/test/utilities/general-functions.spec.js +++ b/test/utilities/general-functions.spec.js @@ -1,6 +1,6 @@ import { firstToUpper, fitArrayToSize, longestArray, mapString, rearrangeArray, switchMembers, twoDigitFormat -} from '../../utilities' +} from '../../src/utilities' describe('general-functions', () => { it('#firstToUpper', () => { diff --git a/src/test/utilities/music-functions.spec.js b/test/utilities/music-functions.spec.js similarity index 96% rename from src/test/utilities/music-functions.spec.js rename to test/utilities/music-functions.spec.js index 48ce3a9..30eadd8 100644 --- a/src/test/utilities/music-functions.spec.js +++ b/test/utilities/music-functions.spec.js @@ -1,8 +1,8 @@ import { extractOctave, extractPitchClass, getPitchClassesInterval, intervalsToNotes, notesInRange, noteToObject, pitchClassesToNotes, pitchClassesToPianoChordNotes, transposeNote -} from '../../utilities' -import { Chord, PitchClass } from '../../theory' +} from '../../src/utilities' +import { Chord, PitchClass } from '../../src/theory' describe('Music addon functions', () => { describe('#getPitchClassesInterval', () => { diff --git a/src/test/utilities/pure-music-utils.spec.js b/test/utilities/pure-music-utils.spec.js similarity index 99% rename from src/test/utilities/pure-music-utils.spec.js rename to test/utilities/pure-music-utils.spec.js index f9ba34d..9a0d547 100644 --- a/src/test/utilities/pure-music-utils.spec.js +++ b/test/utilities/pure-music-utils.spec.js @@ -1,6 +1,6 @@ import { enharmonicPitchClass, getNotesInterval, getPatternFromNotes, getPatternFromPitchClasses, normalizePitchClass, toFlat -} from '../../utilities' +} from '../../src/utilities' describe('#PureMusicUtils', () => { describe('#enharmonicPitchClass', () => { diff --git a/src/test/utilities/scientific-functions.spec.js b/test/utilities/scientific-functions.spec.js similarity index 88% rename from src/test/utilities/scientific-functions.spec.js rename to test/utilities/scientific-functions.spec.js index 42a3693..51753a6 100644 --- a/src/test/utilities/scientific-functions.spec.js +++ b/test/utilities/scientific-functions.spec.js @@ -1,4 +1,4 @@ -import * as funcs from '../../utilities/ScientificFunctions' +import * as funcs from '../../src/utilities/ScientificFunctions' describe('Scientific functions', () => { it('#freqFromPitch', () => { diff --git a/src/test/validation/pattern-rule.spec.js b/test/validation/pattern-rule.spec.js similarity index 85% rename from src/test/validation/pattern-rule.spec.js rename to test/validation/pattern-rule.spec.js index 3cd5ea7..9f0ab9a 100644 --- a/src/test/validation/pattern-rule.spec.js +++ b/test/validation/pattern-rule.spec.js @@ -1,5 +1,5 @@ -import { PatternRule } from '../../' -import { InvalidInput } from '../../Exceptions' +import { PatternRule } from '../../src' +import { InvalidInput } from '../../src/Exceptions' describe('Pattern Rule', () => { describe('#isPattern', () => { diff --git a/src/test/validation/pitch-class-rule.spec.js b/test/validation/pitch-class-rule.spec.js similarity index 94% rename from src/test/validation/pitch-class-rule.spec.js rename to test/validation/pitch-class-rule.spec.js index 590afa3..b41e64b 100644 --- a/src/test/validation/pitch-class-rule.spec.js +++ b/test/validation/pitch-class-rule.spec.js @@ -1,4 +1,4 @@ -import { PitchClassRule } from '../../validation' +import { PitchClassRule } from '../../src/validation' describe('Pitch Class Rule', () => { it('should return true when valid', () => { diff --git a/src/test/validation/validators.spec.js b/test/validation/validators.spec.js similarity index 95% rename from src/test/validation/validators.spec.js rename to test/validation/validators.spec.js index 2cad02d..58e2c8b 100644 --- a/src/test/validation/validators.spec.js +++ b/test/validation/validators.spec.js @@ -1,5 +1,5 @@ -import { PitchClass, validateDuration, validateInstance, validateRawNote } from '../../' -import { InvalidInput } from '../../Exceptions' +import { PitchClass, validateDuration, validateInstance, validateRawNote } from '../../src' +import { InvalidInput } from '../../src/Exceptions' describe('#Validators', () => { describe('#validateInstance', () => { diff --git a/tsconfig.json b/tsconfig.json index 77762cf..18f395d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,6 @@ "noFallthroughCasesInSwitch": true, "pretty": true, "resolveJsonModule": true, - "rootDir": "src", "paths": { "src": ["./src"], "tone": ["node_modules/tone"]