Skip to content

Commit

Permalink
Merge pull request #1025 from ronyeh/migration/test/easyscore
Browse files Browse the repository at this point in the history
Migrate EasyScoreTests
  • Loading branch information
0xfe authored Jun 12, 2021
2 parents 6058799 + 6075f71 commit d050050
Show file tree
Hide file tree
Showing 8 changed files with 467 additions and 406 deletions.
2 changes: 1 addition & 1 deletion src/easyscore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ export class EasyScore {

// TODO: Add stricter typing after migrating Factory
// eslint-disable-next-line
voice(notes: StaveNote[], options: any): Voice {
voice(notes: StaveNote[], options?: any): Voice {
options = { time: this.defaults.time, ...options };
return this.factory.Voice(options).addTickables(notes);
}
Expand Down
4 changes: 4 additions & 0 deletions src/frethandfinger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export class FretHandFinger extends Modifier {
return this;
}

getFretHandFinger(): string {
return this.finger;
}

setOffsetX(x: number): this {
this.x_offset = x;
return this;
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ Vex.Flow.Registry = Registry;
Vex.Flow.StaveText = StaveText;
Vex.Flow.GlyphNote = GlyphNote;
Vex.Flow.RepeatNote = RepeatNote;

Vex.Flow.Font = Font;
Vex.Flow.Fonts = Fonts;
Vex.Flow.TextFont = TextFont;
Expand Down
1 change: 0 additions & 1 deletion src/modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export class Modifier extends Element {
return this;
}

// Get and set articulation position.
getPosition(): number {
return this.position;
}
Expand Down
37 changes: 35 additions & 2 deletions tests/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,46 @@
declare const global: any;

export const QUnit = global.QUnit;
export const ok = global.ok;
export const notOk = global.notOk;
export const test = global.test;
export const expect = global.expect;
export const ok = global.ok;
export const notOk = global.notOk;
export const equal = global.equal;
export const notEqual = global.notEqual;
export const deepEqual = global.deepEqual;
export const notDeepEqual = global.notDeepEqual;
export const strictEqual = global.strictEqual;
export const notStrictEqual = global.notStrictEqual;

// See: https://api.qunitjs.com/assert/
// TODO: npm install @types/qunit
/* eslint-disable @typescript-eslint/no-explicit-any */
export interface Assert {
expect(amount: number): void;
ok(state: any, message?: string): void;
notOk(state: any, message?: string): void;
equal(actual: any, expected: any, message?: string): void;
notEqual(actual: any, expected: any, message?: string): void;
deepEqual<T>(actual: T, expected: T, message?: string): void;
notDeepEqual(actual: any, expected: any, message?: string): void;
strictEqual<T>(actual: T, expected: T, message?: string): void;
notStrictEqual(actual: any, expected: any, message?: string): void;
true(state: any, message?: string): void;
false(state: any, message?: string): void;
propEqual(actual: any, expected: any, message?: string): void;
notPropEqual(actual: any, expected: any, message?: string): void;
async(acceptCallCount?: number): () => void;
pushResult(assertResult: { result: boolean; actual: any; expected: any; message: string }): void;
rejects(promise: Promise<any>, message?: string): Promise<void>;
rejects(promise: Promise<any>, expectedMatcher?: any, message?: string): Promise<void>;
step(message: string): void;
verifySteps(steps: string[], message?: string): void;
throws(block: () => void, expected?: any, message?: any): void;
raises(block: () => void, expected?: any, message?: any): void;
}
/* eslint-enable @typescript-eslint/no-explicit-any */

// See: vexflow_test_helpers.
export interface TestOptions {
assert: Assert;
}
Loading

0 comments on commit d050050

Please sign in to comment.