-
-
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.
#45 update file structure, update tests, update webpack config
- Loading branch information
1 parent
517ed53
commit 4d707a5
Showing
13 changed files
with
52 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
index: './pages/index/index.js', | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
'use strict'; | ||
|
||
import GameOfLife from '@/game-of-life.js'; | ||
const ENTRIES = require('./entries.js'); | ||
const PAGES = require('./pages.js'); | ||
|
||
new GameOfLife(); | ||
module.exports = { | ||
ENTRIES, | ||
PAGES, | ||
}; |
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,12 @@ | ||
'use strict'; | ||
|
||
const HTMLWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = [ | ||
new HTMLWebpackPlugin({ | ||
inject: true, | ||
template: './pages/index/index.html', | ||
filename: 'index.html', | ||
chunks: ['index'], | ||
}), | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
import GameOfLife from '@/game/game-of-life.js'; | ||
|
||
new GameOfLife(); |
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,35 +1,30 @@ | ||
'use strict'; | ||
|
||
import { getRandomInteger } from '@/helpers.js'; | ||
import { getRandomInteger } from '@/engine/helpers.js'; | ||
|
||
describe('[Helpers] function getRandomInteger', () => { | ||
test('Call without params', () => { | ||
expect(getRandomInteger()).toBe(0); | ||
const number = getRandomInteger(); | ||
|
||
expect(number).toBe(0); | ||
expect(typeof number).toBe('number'); | ||
}); | ||
|
||
test('Generate number and only number', () => { | ||
test('Generate many time number with params', () => { | ||
const min = 0; | ||
const max = 10; | ||
const count = 100; | ||
const arr = []; | ||
let isValid = true; | ||
|
||
for (let i = 0; i < count; i++) { | ||
arr.push(getRandomInteger(min, max)); | ||
} | ||
|
||
const isntValid = false; | ||
const number = getRandomInteger(min, max); | ||
|
||
for (let i = 0; i < arr.length; i++) { | ||
if (!typeof arr[i] === 'number') { | ||
isntValid = true; | ||
} else { | ||
if (Math.trunc(arr[i]) !== arr[i]) { | ||
isntValid = true; | ||
} | ||
if (!typeof number === 'number' || | ||
number < min || number >= max) { | ||
isValid = false; | ||
} | ||
if (isntValid) break; | ||
} | ||
|
||
expect(arr.includes(true)).not.toBe(true); | ||
expect(isValid).toBe(true); | ||
}); | ||
}); |
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