Skip to content

Commit

Permalink
New words (#237)
Browse files Browse the repository at this point in the history
* NEW-WORDS Cleanup

* NEW-WORDS Cleanup

* NEW-WORDS New Words

* NEW-WORDS Cleanup

* NEW-WORDS Cleanup

* NEW-WORDS Cleanup

* NEW-WORDS Added New Words

* NEW-WORDS Cleanup
  • Loading branch information
hrai committed Jul 3, 2023
1 parent 15b7da6 commit 51a5a27
Show file tree
Hide file tree
Showing 6 changed files with 970 additions and 955 deletions.
7 changes: 6 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ module.exports = {
// The test environment that will be used for testing
testEnvironment: 'jsdom',

testEnvironmentOptions: {
customExportConditions: ['node'],
},

// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},

Expand Down Expand Up @@ -170,6 +174,7 @@ module.exports = {
// transformIgnorePatterns: [
// "/node_modules/"
// ],
transformIgnorePatterns: ['/node_modules/(?!(sinon)/)'],

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
Expand All @@ -182,4 +187,4 @@ module.exports = {

// Whether to use watchman for file crawling
// watchman: true,
}
};
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"singleQuote": true
},
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/eslint-parser": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"bootstrap": "^5.2.3",
"@babel/core": "^7.22.5",
"@babel/eslint-parser": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"bootstrap": "^5.3.0",
"copy-webpack-plugin": "^11.0.0",
"daily-version": "^2.0.0",
"dot-json": "^1.3.0",
"eslint": "^8.41.0",
"eslint": "^8.43.0",
"eslint-webpack-plugin": "^4.0.1",
"express": "^4.18.2",
"express-rate-limit": "^6.7.0",
Expand All @@ -50,12 +50,12 @@
"nodemon": "^2.0.22",
"prettier": "^2.8.8",
"run-script-os": "^1.1.3",
"sinon": "^15.1.0",
"sinon": "^15.2.0",
"web-ext": "^7.6.2",
"web-ext-submit": "^7.6.2",
"webextension-polyfill": "^0.10.0",
"webpack": "^5.83.1",
"webpack-cli": "^5.1.1"
"webpack": "^5.88.0",
"webpack-cli": "^5.1.4"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -86,6 +86,6 @@
}
},
"dependencies": {
"chrome-webstore-upload-cli": "^2.2.0"
"chrome-webstore-upload-cli": "^2.2.1"
}
}
11 changes: 5 additions & 6 deletions src/acronym-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const commonAcronyms = [
'TC',
'TGIF',
'TIA',
'TIL',
'TMZ',
'TTYL',
'TWA',
Expand Down Expand Up @@ -123,6 +124,7 @@ const commonTechAcronyms = [
'CORS',
'CPU',
'CSS',
'CSV',
'DB',
'DDoS',
'DI',
Expand Down Expand Up @@ -407,6 +409,7 @@ let awsAcronyms = [
'AZ',
'CDK',
'CF',
'CW',
'DLQ',
'EBS',
'EC2',
Expand All @@ -423,18 +426,14 @@ let awsAcronyms = [
'SES',
'SNS',
'SQS',
'SSM',
'STS',
'SWF',
'VPC',
'VPG',
];

let gcpAcronyms = [
'GCE',
'GCP',
'GCS',
'GKE',
];
let gcpAcronyms = ['GCE', 'GCP', 'GCS', 'GKE'];

let commonLocalAcronyms = ['Syd', 'Melb', 'AdID', 'AdIDs', 'ABN', 'ACN'];

Expand Down
2 changes: 2 additions & 0 deletions src/name-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,7 @@ let personNames = [
'Mickie',
'Micky',
'Miguel',
'Mike',
'Mikhail',
'Mikoyan',
'Milagros',
Expand Down Expand Up @@ -3776,6 +3777,7 @@ const commonTechNames = [
'DynamoDB',
'ECMAScript',
'Emacs',
'GraphQL',
'HBase',
'Instagram',
'JavaScript',
Expand Down
54 changes: 27 additions & 27 deletions test/util-stub.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sinon from 'sinon';
import * as utils from '../src/utils.js';
import sinon from 'sinon';

describe('capitaliseText', () => {
test('capitaliseText_HtmlContent', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.',
innerHTML: "I'm the content of html tag.",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
Expand All @@ -25,10 +25,10 @@ describe('capitaliseText', () => {
expect(element.tagName.calledOnce).toBeTruthy;

expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(shouldCapitaliseForIFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
});

Expand Down Expand Up @@ -66,7 +66,7 @@ describe('capitaliseText', () => {
test('capitaliseText_NoTagName', () => {
const element = {
isContentEditable: true,
innerHTML: 'I\'m the content of html tag.',
innerHTML: "I'm the content of html tag.",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
Expand All @@ -90,7 +90,7 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.<br>',
innerHTML: "I'm the content of html tag.<br>",
};

const shouldCapitaliseFake = sinon.fake();
Expand Down Expand Up @@ -195,11 +195,11 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html taG',
innerHTML: "I'm the content of html taG",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
const getTextFake = sinon.fake.returns('I\'m the content of html taG');
const getTextFake = sinon.fake.returns("I'm the content of html taG");
const setTextFake = sinon.fake();

expect(
Expand All @@ -222,7 +222,7 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html taG',
innerHTML: "I'm the content of html taG",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
Expand All @@ -248,7 +248,7 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.<br>',
innerHTML: "I'm the content of html tag.<br>",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
Expand All @@ -267,10 +267,10 @@ describe('capitaliseText', () => {
expect(element.tagName.calledOnce).toBeFalsy;

expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(shouldCapitaliseForIFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
});

Expand All @@ -279,7 +279,7 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.<br>',
innerHTML: "I'm the content of html tag.<br>",
};
const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
Expand All @@ -301,12 +301,12 @@ describe('capitaliseText', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.',
innerHTML: "I'm the content of html tag.",
};

const shouldCapitaliseFake = sinon.fake();
const shouldCapitaliseForIFake = sinon.fake();
const getTextFake = sinon.fake.returns('I\'m the content of html tag.');
const getTextFake = sinon.fake.returns("I'm the content of html tag.");
const setTextFake = sinon.fake();

utils.capitaliseText(
Expand All @@ -318,27 +318,27 @@ describe('capitaliseText', () => {
);

expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(shouldCapitaliseForIFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(getTextFake.getCall(0).args[0]).toBe(element);
expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
});

test('capitaliseText_SetText_ShouldCapitaliseTrue', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.',
innerHTML: "I'm the content of html tag.",
};

const shouldCapitaliseFake = sinon.fake.returns(true);
const shouldCapitaliseForIFake = sinon.fake();
const getTextFake = sinon.fake.returns('I\'m the content of html tag.');
const getTextFake = sinon.fake.returns("I'm the content of html tag.");
const setTextFake = sinon.fake();

utils.capitaliseText(
Expand All @@ -350,25 +350,25 @@ describe('capitaliseText', () => {
);

expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(shouldCapitaliseForIFake.getCall(0)).toBeNull();
expect(getTextFake.getCall(0).args[0]).toBe(element);
expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
});

test('capitaliseText_SetText_ShouldCapitaliseFalse', () => {
const element = {
isContentEditable: true,
tagName: 'div',
innerHTML: 'I\'m the content of html tag.',
innerHTML: "I'm the content of html tag.",
};

const shouldCapitaliseFake = sinon.fake.returns(false);
const shouldCapitaliseForIFake = sinon.fake();
const getTextFake = sinon.fake.returns('I\'m the content of html tag.');
const getTextFake = sinon.fake.returns("I'm the content of html tag.");
const setTextFake = sinon.fake();

utils.capitaliseText(
Expand All @@ -380,14 +380,14 @@ describe('capitaliseText', () => {
);

expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(shouldCapitaliseForIFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
expect(getTextFake.getCall(0).args[0]).toBe(element);
expect(shouldCapitaliseFake.getCall(0).args[0]).toBe(
'I\'m the content of html tag.'
"I'm the content of html tag."
);
});
});
Expand Down
Loading

0 comments on commit 51a5a27

Please sign in to comment.