Skip to content

Commit 5d5e1c4

Browse files
committed
chore: fix some tests
1 parent a9d4d5a commit 5d5e1c4

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/sfProject.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ export class SfProjectJson extends ConfigFile<ConfigFile.Options, ProjectJson> {
286286
/**
287287
* Has at least one package alias defined in the project.
288288
*/
289-
public hasPackageAliases(): boolean {
289+
// eslint-disable-next-line @typescript-eslint/require-await
290+
public async hasPackageAliases(): Promise<boolean> {
290291
return Object.keys(this.getContents().packageAliases ?? {}).length > 0;
291292
}
292293

@@ -374,7 +375,8 @@ export class SfProjectJson extends ConfigFile<ConfigFile.Options, ProjectJson> {
374375
/**
375376
* Has at least one package bundle alias defined in the project.
376377
*/
377-
public hasPackageBundleAliases(): boolean {
378+
// eslint-disable-next-line @typescript-eslint/require-await
379+
public async hasPackageBundleAliases(): Promise<boolean> {
378380
return Object.keys(this.getContents().packageBundleAliases ?? {}).length > 0;
379381
}
380382

@@ -776,7 +778,7 @@ export class SfProject {
776778
return this.projectConfig;
777779
}
778780

779-
public hasPackageAliases(): boolean {
781+
public async hasPackageAliases(): Promise<boolean> {
780782
return this.getSfProjectJson().hasPackageAliases();
781783
}
782784

test/unit/project.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -740,15 +740,15 @@ describe('SfProject', () => {
740740
const project = SfProject.getInstance();
741741
expect(project.getPackageAliases()).to.be.undefined;
742742
});
743-
it('should return false no aliases are defined', () => {
743+
it('should return false no aliases are defined', async () => {
744744
$$.setConfigStubContents('SfProjectJson', {
745745
contents: {},
746746
});
747747

748748
const project = SfProject.getInstance();
749-
expect(project.hasPackageAliases()).to.be.false;
749+
expect(await project.hasPackageAliases()).to.be.false;
750750
});
751-
it('should return true when at least one alias is defined', () => {
751+
it('should return true when at least one alias is defined', async () => {
752752
$$.setConfigStubContents('SfProjectJson', {
753753
contents: {
754754
packageAliases: {
@@ -758,7 +758,7 @@ describe('SfProject', () => {
758758
});
759759

760760
const project = SfProject.getInstance();
761-
expect(project.hasPackageAliases()).to.be.true;
761+
expect(await project.hasPackageAliases()).to.be.true;
762762
});
763763
it('should return the defined package aliases', () => {
764764
$$.setConfigStubContents('SfProjectJson', {
@@ -968,15 +968,15 @@ describe('SfProject', () => {
968968
const project = SfProject.getInstance();
969969
expect(project.getSfProjectJson().getPackageBundleAliases()).to.be.undefined;
970970
});
971-
it('should return false when no bundle aliases are defined', () => {
971+
it('should return false when no bundle aliases are defined', async () => {
972972
$$.setConfigStubContents('SfProjectJson', {
973973
contents: {},
974974
});
975975

976976
const project = SfProject.getInstance();
977-
expect(project.getSfProjectJson().hasPackageBundleAliases()).to.be.false;
977+
expect(await project.getSfProjectJson().hasPackageBundleAliases()).to.be.false;
978978
});
979-
it('should return true when at least one bundle alias is defined', () => {
979+
it('should return true when at least one bundle alias is defined', async () => {
980980
$$.setConfigStubContents('SfProjectJson', {
981981
contents: {
982982
packageBundleAliases: {
@@ -986,7 +986,7 @@ describe('SfProject', () => {
986986
});
987987

988988
const project = SfProject.getInstance();
989-
expect(project.getSfProjectJson().hasPackageBundleAliases()).to.be.true;
989+
expect(await project.getSfProjectJson().hasPackageBundleAliases()).to.be.true;
990990
});
991991
it('should return the defined package aliases', () => {
992992
$$.setConfigStubContents('SfProjectJson', {

0 commit comments

Comments
 (0)