-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data changes and minor fixes to effects and jump squat fix
- Loading branch information
1 parent
8b8e31e
commit d0e2117
Showing
16 changed files
with
780 additions
and
547 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
export const versionNumber = '2.5.3'; | ||
export const versionNumber = '2.5.4'; |
File renamed without changes.
File renamed without changes.
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,70 @@ | ||
import 'reflect-metadata'; | ||
import winston from 'winston'; | ||
import { Loader } from '../src/data/loader'; | ||
import { Search } from '../src/data/search'; | ||
import { AliasParser } from '../src/data/alias-parser'; | ||
import { expect, test } from '@jest/globals'; | ||
import { SearchResultType } from '../src/models/search/search-result-type'; | ||
import { describe } from 'node:test'; | ||
|
||
test('Ensure search works with characters', async () => { | ||
const search = await setupSearch(); | ||
const marth = search.searchCharacter(['Marth']); | ||
expect(marth).toBeDefined(); | ||
expect(marth!.name).toBe('Marth'); | ||
expect(marth!.normalizedName).toBe('marth'); | ||
}); | ||
|
||
test('Ensure search works with an alias', async () => { | ||
const search = await setupSearch(); | ||
const marth = search.searchCharacter(['Puff']); | ||
expect(marth).toBeDefined(); | ||
expect(marth!.name).toBe('Jigglypuff'); | ||
expect(marth!.normalizedName).toBe('jigglypuff'); | ||
}); | ||
|
||
test('Ensure move search works for a basic move', async () => { | ||
const search = await setupSearch(); | ||
const move = search.search('marth fsmash'); | ||
expect(move).toBeDefined(); | ||
expect(move.type).toBe(SearchResultType.Move); | ||
expect(move.move.name).toBe('Forward Smash'); | ||
expect(move.character.name).toBe('Marth'); | ||
}); | ||
|
||
describe('Ensure move search works with different cases', () => { | ||
const cases = [ | ||
['Marth usmash', 'Marth', 'Up Smash'], | ||
['fox shine', 'Fox', 'Reflector'], | ||
['shine', 'Fox', 'Reflector'], | ||
['falcon knee', 'Captain Falcon', 'Forward Air'], | ||
['gnw hammer', 'Mr. Game & Watch', 'Judgement'], | ||
['rest', 'Jigglypuff', 'Rest'], | ||
]; | ||
|
||
test.each(cases)('Ensure move search works for %s', async (query: string, expectedCharacter: string, expectedMove: string) => { | ||
const search = await setupSearch(); | ||
const move = search.search(query); | ||
expect(move).toBeDefined(); | ||
expect(move.type).toBe(SearchResultType.Move); | ||
expect(move.move.name).toBe(expectedMove); | ||
expect(move.character.name).toBe(expectedCharacter); | ||
}); | ||
}); | ||
|
||
async function setupSearch(): Promise<Search> { | ||
// Create a silent unit test logger. | ||
const logger = winston.createLogger({ | ||
transports: [ | ||
new winston.transports.Console({ | ||
// Set the level to silent to prevent any output | ||
level: 'silent', | ||
}), | ||
], | ||
}); | ||
|
||
const loader = new Loader(logger); | ||
await loader.ensureLoaded(); | ||
const aliasParser = new AliasParser(loader); | ||
return new Search(aliasParser); | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"rootDir": "./src", | ||
}, | ||
"exclude": [ | ||
"tests/**/*.test.ts" | ||
"tests/**/*.test.ts", | ||
"tests/**/*-test.ts" | ||
] | ||
} |