aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrii Kostenko <[email protected]>2021-06-05 19:39:06 +0300
committerAndrii Kostenko <[email protected]>2021-06-05 19:39:06 +0300
commit3aac69e8ab0d0337580de688a8e0134a20fdcc08 (patch)
tree6c646d299406e202176b25cd590f3de43d3a2bba /test
parent9c917bae5adf7046fc08b2ecac7702711557e4b9 (diff)
downloadfaker-3aac69e8ab0d0337580de688a8e0134a20fdcc08.tar.xz
faker-3aac69e8ab0d0337580de688a8e0134a20fdcc08.zip
change domainWord generation algorithm to <adjective>-<noun>
Diffstat (limited to 'test')
-rw-r--r--test/internet.unit.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/internet.unit.js b/test/internet.unit.js
index f615656c..7f25f5bd 100644
--- a/test/internet.unit.js
+++ b/test/internet.unit.js
@@ -88,24 +88,28 @@ describe("internet.js", function () {
});
describe("domainWord()", function () {
- it("returns a lower-case firstName", function () {
- sinon.stub(faker.name, 'firstName').returns('FOO');
+ it("returns a lower-case adjective + noun", function () {
+ sinon.stub(faker.word, 'adjective').returns('RANDOM');
+ sinon.stub(faker.word, 'noun').returns('WORD');
var domain_word = faker.internet.domainWord();
assert.ok(domain_word);
- assert.strictEqual(domain_word, 'foo');
+ assert.strictEqual(domain_word, 'random-word');
- faker.name.firstName.restore();
+ faker.word.adjective.restore();
+ faker.word.noun.restore();
});
describe("when the firstName used contains a apostrophe", function () {
- sinon.stub(faker.name, 'firstName').returns('d\'angelo');
+ sinon.stub(faker.word, 'adjective').returns('an\'other');
+ sinon.stub(faker.word, 'noun').returns('no\'un');
var domain_word = faker.internet.domainWord();
it("should remove the apostrophe", function () {
- assert.strictEqual(domain_word, 'dangelo');
+ assert.strictEqual(domain_word, 'another-noun');
});
- faker.name.firstName.restore();
+ faker.word.adjective.restore();
+ faker.word.noun.restore();
});
});