Skip to content

Commit a007206

Browse files
committed
update
1 parent 2a4d003 commit a007206

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

js/utils/__tests__/musicutils.test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("musicutils", () => {
4141
});
4242

4343
describe("Temperament Functions", () => {
44-
test("getTemperamentsList should return the list of temperaments", () => {
44+
it("getTemperamentsList should return the list of temperaments", () => {
4545
expect(getTemperamentsList()).toEqual([
4646
[_("Equal (12EDO)"), "equal", "equal"],
4747
[_("Equal (5EDO)"), "equal5", "equal5"],
@@ -114,35 +114,35 @@ describe("Temperament Functions", () => {
114114
};
115115
});
116116

117-
test("addTemperamentToList should add a new temperament if not predefined", () => {
117+
it("addTemperamentToList should add a new temperament if not predefined", () => {
118118
const newEntry = "customTemperament";
119119
addTemperamentToList(newEntry);
120120
expect(TEMPERAMENTS).toContain(newEntry);
121121
});
122122

123-
test("addTemperamentToList should not add a predefined temperament", () => {
123+
it("addTemperamentToList should not add a predefined temperament", () => {
124124
const predefinedEntry = "equal";
125125
addTemperamentToList(predefinedEntry);
126126
expect(TEMPERAMENTS).not.toContain(predefinedEntry);
127127
});
128128

129-
test("deleteTemperamentFromList should remove a temperament from the dictionary", () => {
129+
it("deleteTemperamentFromList should remove a temperament from the dictionary", () => {
130130
const oldEntry = "equal";
131131
deleteTemperamentFromList(oldEntry);
132132
expect(TEMPERAMENT[oldEntry]).toBeUndefined();
133133
});
134134

135-
test("addTemperamentToDictionary should add a new temperament to the dictionary", () => {
135+
it("addTemperamentToDictionary should add a new temperament to the dictionary", () => {
136136
const entryName = "newTemperament";
137137
const entryValue = {
138138
pitchNumber: 7,
139139
interval: ["perfect 1", "minor 3", "major 3"]
140140
};
141141
addTemperamentToDictionary(entryName, entryValue);
142-
expect(TEMPERAMENT[entryName]).toEqual(entryValue);
142+
it(TEMPERAMENT[entryName]).toEqual(entryValue);
143143
});
144144

145-
test("updateTemperaments should update TEMPERAMENTS with new entries", () => {
145+
it("updateTemperaments should update TEMPERAMENTS with new entries", () => {
146146
const newEntry = "customTemperament";
147147
TEMPERAMENT[newEntry] = {
148148
pitchNumber: 8,
@@ -152,7 +152,7 @@ describe("Temperament Functions", () => {
152152
expect(TEMPERAMENTS.some(([_, name]) => name === newEntry)).toBe(true);
153153
});
154154

155-
test("updateTemperaments should not duplicate predefined temperaments", () => {
155+
it("updateTemperaments should not duplicate predefined temperaments", () => {
156156
updateTemperaments();
157157
const predefinedEntries = TEMPERAMENTS.filter(([_, name]) => name in PreDefinedTemperaments);
158158
expect(predefinedEntries.length).toBe(Object.keys(PreDefinedTemperaments).length);
@@ -161,42 +161,42 @@ describe("Temperament Functions", () => {
161161
});
162162

163163
describe("Constants", () => {
164-
test("should have correct default values", () => {
164+
it("should have correct default values", () => {
165165
expect(DEFAULTINVERT).toBe("even");
166166
expect(DEFAULTMODE).toBe("major");
167167
});
168168
});
169169

170170
describe("customMode", () => {
171-
test("should return custom mode from MUSICALMODES", () => {
171+
it("should return custom mode from MUSICALMODES", () => {
172172
expect(customMode).toEqual([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
173173
});
174174
});
175175

176176
describe("getInvertMode", () => {
177-
test("should return the correct invert mode name", () => {
177+
it("should return the correct invert mode name", () => {
178178
expect(getInvertMode("even")).toBe("even");
179179
expect(getInvertMode("scalar")).toBe("scalar");
180180
expect(getInvertMode("nonexistent")).toBe("nonexistent");
181181
});
182182
});
183183

184184
describe("getIntervalNumber", () => {
185-
test("should return the number of semi-tones for a given interval", () => {
185+
it("should return the number of semi-tones for a given interval", () => {
186186
expect(getIntervalNumber("perfect 5")).toBe(7);
187187
expect(getIntervalNumber("major 3")).toBe(4);
188188
});
189189
});
190190

191191
describe("getIntervalDirection", () => {
192-
test("should return the direction of the interval", () => {
192+
it("should return the direction of the interval", () => {
193193
expect(getIntervalDirection("diminished 6")).toBe(-1);
194194
expect(getIntervalDirection("minor 3")).toBe(-1);
195195
});
196196
});
197197

198198
describe("getIntervalRatio", () => {
199-
test("should return the ratio for a given interval", () => {
199+
it("should return the ratio for a given interval", () => {
200200
expect(getIntervalRatio("perfect 5")).toBe(1.5);
201201
expect(getIntervalRatio("major 3")).toBe(1.25);
202202
});
@@ -205,17 +205,17 @@ describe("getIntervalRatio", () => {
205205
//
206206

207207
describe("getModeNumbers", () => {
208-
test("should return the correct mode numbers for a valid mode", () => {
208+
it("should return the correct mode numbers for a valid mode", () => {
209209
expect(getModeNumbers("chromatic")).toBe("0 1 2 3 4 5 6 7 8 9 10 11");
210210
expect(getModeNumbers("major")).toBe("0 2 4 5 7 9 11");
211211
expect(getModeNumbers("minor")).toBe("0 2 3 5 7 8 10");
212212
});
213213

214-
test("should return an empty string for an invalid mode", () => {
214+
it("should return an empty string for an invalid mode", () => {
215215
expect(getModeNumbers("invalidMode")).toBe("");
216216
});
217217

218-
test("should handle custom mode correctly", () => {
218+
it("should handle custom mode correctly", () => {
219219
expect(getModeNumbers("custom")).toBe("0 1 2 3 4 5 6 7 8 9 10 11");
220220
});
221221
});

0 commit comments

Comments
 (0)