@@ -10,54 +10,46 @@ describe('Original BCDice Test', () => {
1010 . filter ( file => file . match ( / \. t x t $ / ) )
1111 . filter ( file => ! [
1212 // Test Failed
13- '_InsaneScp.txt' ,
14- 'AceKillerGene.txt' ,
15- 'BlindMythos.txt' ,
16- 'BloodMoon.txt' ,
17- 'ColossalHunter.txt' ,
18- 'Cthulhu7th.txt' ,
19- 'Cthulhu7th_Korean.txt' ,
20- 'DarkDaysDrive.txt' ,
21- 'DetatokoSaga.txt' ,
22- 'DetatokoSaga_Korean.txt' ,
23- 'Dracurouge.txt' ,
24- 'Dracurouge_Korean.txt' ,
25- 'EarthDawn.txt' ,
26- 'EarthDawn3.txt' ,
27- 'EarthDawn4.txt' ,
28- 'EclipsePhase.txt' ,
29- 'Elysion.txt' ,
30- 'FilledWith.txt' ,
31- 'GardenOrder.txt' ,
32- 'GurpsFW.txt' ,
33- 'IthaWenUa.txt' ,
34- 'Kamigakari.txt' ,
35- 'KillDeathBusiness.txt' ,
36- 'KillDeathBusiness_Korean.txt' ,
37- 'LogHorizon.txt' ,
38- 'LogHorizon_Korean.txt' ,
39- 'MagicaLogia.txt' ,
40- 'MetalHeadExtream.txt' ,
41- 'OneWayHeroics.txt' ,
42- 'Oukahoushin3rd.txt' ,
43- 'Peekaboo.txt' ,
44- 'PlotTest.txt' ,
45- 'Ryutama.txt' ,
46- 'ShinMegamiTenseiKakuseihen.txt' ,
47- 'Skynauts.txt' ,
48- 'SwordWorld2_0.txt' ,
49- 'SwordWorld2_5.txt' ,
50- 'Warhammer.txt' ,
51- 'None.txt' ,
52- 'SevenFortressMobius.txt' ,
53- 'NightWizard.txt' ,
54- 'NightWizard3rd.txt' ,
55- 'Postman.txt' ,
56- 'StellarKnights.txt' ,
57-
58- // Execution Error
59- 'CthulhuTech.txt' ,
60- ] . some ( a => a === file ) ) ;
13+ '_InsaneScp' ,
14+ 'ArsMagica' ,
15+ 'AceKillerGene' ,
16+ 'BloodMoon' ,
17+ 'Cthulhu7th' ,
18+ 'Cthulhu7th_Korean' ,
19+ 'DetatokoSaga' ,
20+ 'DetatokoSaga_Korean' ,
21+ 'Dracurouge' ,
22+ 'Dracurouge_Korean' ,
23+ 'EarthDawn3' ,
24+ 'EarthDawn4' ,
25+ 'EclipsePhase' ,
26+ 'Elysion' ,
27+ 'FilledWith' ,
28+ 'GardenOrder' ,
29+ 'GurpsFW' ,
30+ 'IthaWenUa' ,
31+ 'Kamigakari' ,
32+ 'KillDeathBusiness' ,
33+ 'KillDeathBusiness_Korean' ,
34+ 'MagicaLogia' ,
35+ 'MetalHeadExtream' ,
36+ 'OneWayHeroics' ,
37+ 'Oukahoushin3rd' ,
38+ 'Peekaboo' ,
39+ 'PlotTest' ,
40+ 'Ryutama' ,
41+ 'ShinMegamiTenseiKakuseihen' ,
42+ 'Skynauts' ,
43+ 'SwordWorld2_0' ,
44+ 'SwordWorld2_5' ,
45+ 'Warhammer' ,
46+ 'None' ,
47+ 'SevenFortressMobius' ,
48+ 'NightWizard' ,
49+ 'NightWizard3rd' ,
50+ 'Postman' ,
51+ 'StellarKnights' ,
52+ ] . some ( a => `${ a } .txt` === file ) ) ;
6153 files . forEach ( ( file ) => {
6254 const gameType = file . replace ( / \. t x t $ / , '' ) ;
6355 describe ( gameType , ( ) => {
@@ -70,29 +62,23 @@ describe('Original BCDice Test', () => {
7062 it ( 'should be valid test' , ( ) => expect ( m ) . toBeTruthy ( ) ) ;
7163
7264 const input = m [ 1 ] . replace ( / \n $ / m, '' ) ;
73- const output = m [ 3 ] . replace ( / \n $ / m, '' ) . replace ( / ダ イ ス 残 り .* $ / , '' ) ;
65+ const output = `: ${ m [ 3 ] . replace ( / \n $ / m, '' ) . replace ( / ダ イ ス 残 り .* $ / , '' ) . replace ( / ^ . * ? : / , '' ) } ` ;
7466 const rand = m [ 5 ] . replace ( / \n $ / m, '' ) ;
75- // console.log({ input, output, rand });
7667
7768 const BCDice = require ( './BCDice' ) . default ;
7869 const bcdice = new BCDice ( ) ;
7970
80- it ( 'should executes command' , ( ) => {
71+ it ( `sould executes dise from " ${ input } " to " ${ output } " with " ${ rand } "` , ( ) => {
8172 bcdice . setRandomValues ( rand . split ( / , / g) . map ( a => a . split ( / \/ / g) ) ) ;
8273 bcdice . setTest ( true ) ;
8374
8475 bcdice . setGameByTitle ( gameType ) ;
8576 bcdice . setMessage ( input ) ;
8677
87- // expect(bcdice.getGameType()).toEqual(gameType);
88-
8978 const [ result , isSecret ] = bcdice . diceCommand ( ) ;
90- // console.log({output, result: `${bcdice.getGameType()} ${result}` });
9179
92- const resultMessage = result === '1'
93- ? `${ input } \n`
94- : `${ input } \n${ bcdice . getGameType ( ) . replace ( / : K o r e a n / , '' ) } ${ result . replace ( / \r / g, '' ) } ${ isSecret ? '###secret dice###' : '' } ` ;
95- expect ( resultMessage ) . toEqual ( `${ input } \n${ output } ` ) ;
80+ const resultMessage = result === '1' ? ':' : `${ result . replace ( / \r / g, '' ) } ${ isSecret ? '###secret dice###' : '' } ` ;
81+ expect ( resultMessage ) . toEqual ( output ) ;
9682 } ) ;
9783 } ) ;
9884 } ) ;
0 commit comments