@@ -1,4 +1,5 @@
|
||||
{
|
||||
"recursive": true,
|
||||
"require": "esm"
|
||||
"require": "esm",
|
||||
"reporter": "min"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
1290
package-lock.json
generated
1290
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"copy-file": "cp dist/CookieMonster.js CookieMonster.js",
|
||||
"eslint-src": "eslint src",
|
||||
"eslint-src": "eslint src test",
|
||||
"build": "run-s eslint-src pack-prod remove-comment copy-file test",
|
||||
"build-test": "run-s pack-dev",
|
||||
"pack-prod": "webpack --env production",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import jscolor from '@eastdesire/jscolor';
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Beautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||
import CMBeautify from '../../Disp/BeautifyAndFormatting/Beautify';
|
||||
import FormatTime from '../../Disp/BeautifyAndFormatting/FormatTime';
|
||||
import { AddAuraInfo, AddDragonLevelUpTooltip } from '../../Disp/Dragon/Dragon';
|
||||
import AddMenu from '../../Disp/MenuSections/AddMenus';
|
||||
@@ -144,7 +144,7 @@ export default function ReplaceNative() {
|
||||
let title = 'Cookie Clicker';
|
||||
if (Game.season === 'fools') title = 'Cookie Baker';
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${Beautify(Game.cookies)} ${
|
||||
Title = `${Game.OnAscend ? 'Ascending! ' : ''}${CMBeautify(Game.cookies)} ${
|
||||
Game.cookies === 1 ? 'cookie' : 'cookies'
|
||||
} - ${title}`;
|
||||
UpdateTitle();
|
||||
|
||||
48
test/t_Disp/t_GetTimeColour.js
Normal file
48
test/t_Disp/t_GetTimeColour.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import { before, describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
|
||||
import { CMOptions } from '../../src/Config/VariablesAndData';
|
||||
|
||||
describe('GetTimeColour', function () {
|
||||
it('Format when time is less than 60', function () {
|
||||
expect(GetTimeColour(59).color).to.deep.equal('Yellow');
|
||||
});
|
||||
it('Format when time is more than 60', function () {
|
||||
expect(GetTimeColour(61).color).to.deep.equal('Orange');
|
||||
});
|
||||
it('Format when time is more than 300', function () {
|
||||
expect(GetTimeColour(301).color).to.deep.equal('Red');
|
||||
});
|
||||
describe('TimeFormat = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 0;
|
||||
});
|
||||
it('Format when time is 0', function () {
|
||||
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', color: 'Green' });
|
||||
});
|
||||
it('Format when time is negative', function () {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: 'Done!',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('TimeFormat = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 1;
|
||||
});
|
||||
it('Format when time is 0', function () {
|
||||
expect(GetTimeColour(0)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
it('Format when time is negative', function () {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user