Skip to content

Commit

Permalink
Improve function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndpnt committed Apr 8, 2024
1 parent 7357620 commit ec90771
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion scripts/declarations/lint/index.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async options => {
if (options.modified) {
const declarationUtils = new DeclarationUtils(instancePath);

({ services: servicesToValidate } = await declarationUtils.getModifiedServicesTermsTypes());
({ services: servicesToValidate } = await declarationUtils.getModifiedServicesAndTermsTypes());
}

const lintFile = lintAndFixFile(options.fix);
Expand Down
2 changes: 1 addition & 1 deletion scripts/declarations/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class DeclarationUtils {
return modifiedServicesIds;
}

async getModifiedServicesTermsTypes() {
async getModifiedServicesAndTermsTypes() {
const { modifiedFilePaths } = await this.getModifiedData();
const servicesTermsTypes = {};

Expand Down
14 changes: 7 additions & 7 deletions scripts/declarations/utils/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const removeLatestCommit = async () => {
};

describe('DeclarationUtils', () => {
describe('#getModifiedServicesTermsTypes', () => {
describe('#getModifiedServicesAndTermsTypes', () => {
before(async () => {
await loadFixtures();
await setupRepository();
Expand All @@ -50,7 +50,7 @@ describe('DeclarationUtils', () => {
after(() => removeLatestCommit());

it('returns the service ID and the updated terms type', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: ['ServiceA'],
servicesTermsTypes: { ServiceA: ['Terms of Service'] },
});
Expand All @@ -62,7 +62,7 @@ describe('DeclarationUtils', () => {
after(() => removeLatestCommit());

it('returns the service ID and the added terms type', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: ['ServiceA'],
servicesTermsTypes: { ServiceA: ['Imprint'] },
});
Expand All @@ -74,7 +74,7 @@ describe('DeclarationUtils', () => {
after(() => removeLatestCommit());

it('returns the added service ID along with the associated terms type', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: ['ServiceB'],
servicesTermsTypes: { ServiceB: ['Terms of Service'] },
});
Expand All @@ -89,7 +89,7 @@ describe('DeclarationUtils', () => {
});

it('returns no services and no terms types', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: [],
servicesTermsTypes: {},
});
Expand All @@ -101,7 +101,7 @@ describe('DeclarationUtils', () => {
after(() => removeLatestCommit());

it('returns no services and no terms types', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: [],
servicesTermsTypes: {},
});
Expand All @@ -120,7 +120,7 @@ describe('DeclarationUtils', () => {
});

it('returns the services IDs and the updated terms types', async () => {
expect(await declarationUtils.getModifiedServicesTermsTypes()).to.deep.equal({
expect(await declarationUtils.getModifiedServicesAndTermsTypes()).to.deep.equal({
services: [ 'ServiceA', 'ServiceB' ],
servicesTermsTypes: {
ServiceA: [ 'Privacy Policy', 'Terms of Service' ],
Expand Down
2 changes: 1 addition & 1 deletion scripts/declarations/validate/index.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async options => {
if (options.modified) {
const declarationUtils = new DeclarationUtils(instancePath);

({ services: servicesToValidate, servicesTermsTypes } = await declarationUtils.getModifiedServicesTermsTypes());
({ services: servicesToValidate, servicesTermsTypes } = await declarationUtils.getModifiedServicesAndTermsTypes());
}

describe('Service declarations validation', async function () {
Expand Down

0 comments on commit ec90771

Please sign in to comment.