Skip to content

Commit

Permalink
test: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuczynski committed Mar 29, 2022
1 parent 3e679fd commit d56e4c7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 28 deletions.
8 changes: 8 additions & 0 deletions test/datatype.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ describe('datatype', () => {
});
expect(actual).toEqual(expectations.number.withMinAndMaxAndPrecision);
});

it('should throw when min > max', () => {
faker.seed(seed);

expect(() => {
faker.datatype.number({ min: 10, max: 9 });
}).toThrowError(`Max should be larger then min: 9 > 10`);
});
});

describe('float', () => {
Expand Down
20 changes: 11 additions & 9 deletions test/system.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@ const seededRuns = [
{
seed: 42,
expectations: {
fileName: 'mobile_application.wad',
commonFileName: 'mobile_application.gif',
fileName: 'mobile_fish.gif',
commonFileName: 'mobile_fish.mpe',
mimeType: 'application/vnd.marlin.drm.license+xml',
commonFileType: 'audio',
commonFileExt: 'png',
fileType: 'image',
fileExt: 'chm',
directoryPath: '/opt/bin',
filePath: '/opt/bin/directives_savings_computer.qwd',
filePath: '/opt/bin/directives_application_home.paw',
semver: '3.7.9',
},
},
{
seed: 1337,
expectations: {
fileName: 'delaware.vcg',
commonFileName: 'delaware.wav',
fileName: 'delaware.uvvt',
commonFileName: 'delaware.mp2',
mimeType: 'application/vnd.dxr',
commonFileType: 'audio',
commonFileExt: 'wav',
fileType: 'font',
fileExt: 'gxt',
directoryPath: '/Library',
filePath: '/Library/bike_kiribati.kpr',
filePath: '/Library/bike_interactive.qwt',
semver: '2.5.1',
},
},
{
seed: 1211,
expectations: {
fileName: 'turnpike_supervisor_chicken.mka',
commonFileName: 'turnpike_supervisor_chicken.mp4v',
fileName: 'turnpike_frozen_handcrafted.mka',
commonFileName: 'turnpike_frozen_handcrafted.mka',
mimeType: 'text/vnd.fmi.flexstor',
commonFileType: 'application',
commonFileExt: 'htm',
fileType: 'x-shader',
fileExt: 'opml',
directoryPath: '/var/log',
filePath: '/var/log/forward_frozen.swf',
filePath: '/var/log/forward_supervisor.swf',
semver: '9.4.8',
},
},
Expand Down Expand Up @@ -101,6 +101,8 @@ describe('system', () => {
'jpeg',
'm2a',
'm2v',
'mp2',
'mp3',
'mp4',
'mp4v',
'mpeg',
Expand Down
38 changes: 19 additions & 19 deletions test/word.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ const seededRuns = [
adjective: {
noArgs: 'harmonious',
length10: 'gregarious',
length20: 'stable',
length20: 'harmonious',
},
adverb: {
noArgs: 'jealously',
length10: 'generously',
length20: 'swiftly',
length20: 'jealously',
},
conjunction: {
noArgs: 'however',
length10: 'as much as',
length20: 'since',
length20: 'however',
},
interjection: {
noArgs: 'yahoo',
length10: 'ack',
length20: 'ack',
length10: 'yahoo',
length20: 'yahoo',
},
noun: {
noArgs: 'gale',
length10: 'exposition',
length20: 'shift',
length20: 'gale',
},
preposition: {
noArgs: 'concerning',
length10: 'throughout',
length20: 'than',
length20: 'concerning',
},
verb: {
noArgs: 'function',
length10: 'exasperate',
length20: 'shred',
length20: 'function',
},
},
},
Expand All @@ -48,37 +48,37 @@ const seededRuns = [
adjective: {
noArgs: 'fabulous',
length10: 'enchanting',
length20: 'neat',
length20: 'fabulous',
},
adverb: {
noArgs: 'frankly',
length10: 'enormously',
length20: 'overconfidently',
length20: 'frankly',
},
conjunction: {
noArgs: 'even if',
length10: 'as long as',
length20: 'instead',
length20: 'even if',
},
interjection: {
noArgs: 'ew',
length10: 'yippee',
length20: 'yippee',
length10: 'ew',
length20: 'ew',
},
noun: {
noArgs: 'digit',
length10: 'depressive',
length20: 'might',
length20: 'digit',
},
preposition: {
noArgs: 'barring',
length10: 'concerning',
length20: 'midst',
length20: 'barring',
},
verb: {
noArgs: 'dispense',
length10: 'demoralize',
length20: 'nearest',
length20: 'dispense',
},
},
},
Expand Down Expand Up @@ -106,7 +106,7 @@ const seededRuns = [
length20: 'er',
},
noun: {
noArgs: 'intercode',
noArgs: 'trick',
length10: 'trafficker',
length20: 'trick',
},
Expand All @@ -116,9 +116,9 @@ const seededRuns = [
length20: 'upon',
},
verb: {
noArgs: 'intercode',
noArgs: 'trick',
length10: 'trampoline',
length20: 'intercede',
length20: 'trick',
},
},
},
Expand Down

0 comments on commit d56e4c7

Please sign in to comment.