-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Arodab/oldschoolbot
- Loading branch information
Showing
238 changed files
with
7,720 additions
and
3,605 deletions.
There are no files selected for viewing
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,4 +1,8 @@ | ||
.env | ||
icon_cache | ||
logs | ||
dist | ||
dist | ||
node_modules | ||
coverage | ||
.yarn | ||
.tests |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { Bank } from 'oldschooljs'; | ||
import { describe, it } from 'vitest'; | ||
|
||
import { Gear } from '../../../src/lib/structures/Gear'; | ||
import { fishCommand } from '../../../src/mahoji/commands/fish'; | ||
import { testRunCmd } from '../utils'; | ||
|
||
describe('Fish Command', () => { | ||
it('should handle insufficient fishing level', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'Trout/Salmon', quantity: 1 }, | ||
result: '<:minion:778418736180494347> Your minion needs 20 Fishing to fish Trout/Salmon.' | ||
}); | ||
}); | ||
|
||
it('should handle insufficient QP', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'karambwanji', quantity: 1 }, | ||
user: { skills_fishing: 9_999_999, QP: 0 }, | ||
result: 'You need 15 qp to catch those!' | ||
}); | ||
}); | ||
|
||
it('should handle invalid fish', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'asdf' }, | ||
result: 'Thats not a valid fish to catch.' | ||
}); | ||
}); | ||
|
||
it('should handle insufficient barb fishing levels', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'Barbarian fishing' }, | ||
user: { skills_fishing: 1 }, | ||
result: '<:minion:778418736180494347> Your minion needs 48 Fishing to fish Barbarian fishing.' | ||
}); | ||
}); | ||
|
||
it('should fish', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'Shrimps/Anchovies' }, | ||
result: "<:minion:778418736180494347> Your minion is now fishing Shrimps/Anchovies, it'll take around 30 minutes to finish" | ||
}); | ||
}); | ||
|
||
it('should catch insufficient feathers', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'Barbarian fishing' }, | ||
user: { | ||
skills_fishing: 999_999, | ||
skills_agility: 999_999, | ||
skills_strength: 999_999, | ||
meleeGear: new Gear({ weapon: 'Pearl barbarian rod' }) | ||
}, | ||
result: 'You need Feather to fish Barbarian fishing!' | ||
}); | ||
}); | ||
|
||
it('should boost', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'Barbarian fishing' }, | ||
user: { | ||
skills_fishing: 999_999, | ||
skills_agility: 999_999, | ||
skills_strength: 999_999, | ||
bank: new Bank().add('Feather', 1000) | ||
}, | ||
result: `<:minion:778418736180494347> Your minion is now fishing 100x Barbarian fishing, it'll take around 6 minutes, 1 second to finish. | ||
**Boosts:** 5% for Pearl barbarian rod.` | ||
}); | ||
}); | ||
|
||
it('should fish barrel boost', () => { | ||
testRunCmd({ | ||
cmd: fishCommand, | ||
opts: { name: 'shrimps' }, | ||
user: { | ||
skills_fishing: 999_999, | ||
meleeGear: new Gear({ cape: 'Fish sack barrel' }) | ||
}, | ||
result: `<:minion:778418736180494347> Your minion is now fishing Shrimps/Anchovies, it'll take around 39 minutes, 1 second to finish. | ||
**Boosts:** +9 trip minutes and +28 inventory slots for having a Fish sack barrel.` | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.