Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/api/commands/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const TEST_ACTOR: ActorCollectionCreateOptions = {

const ACT_TEMPLATE = 'project_empty';

// The API and the local file listing don't guarantee the same order, so source files are compared sorted by name.
const byName = (a: { name: string }, b: { name: string }) => a.name.localeCompare(b.name);

useAuthSetup({ perTest: false });

const {
Expand Down Expand Up @@ -116,7 +119,7 @@ describe('[api] apify push', () => {
},
]);
// TODO: vlad, fix this too
expect((createdActorVersion as any)!.sourceFiles.sort()).to.be.eql(sourceFiles.sort());
expect((createdActorVersion as any)!.sourceFiles.sort(byName)).to.be.eql(sourceFiles.sort(byName));
expect(createdActorVersion!.sourceType).to.be.eql(ACTOR_SOURCE_TYPES.SOURCE_FILES);

// eslint-disable-next-line dot-notation
Expand Down Expand Up @@ -160,7 +163,7 @@ describe('[api] apify push', () => {
value: 'envVarValue',
},
]);
expect((testActorVersion as any).sourceFiles.sort()).to.be.eql(sourceFiles.sort());
expect((testActorVersion as any).sourceFiles.sort(byName)).to.be.eql(sourceFiles.sort(byName));
expect(testActorVersion!.sourceType).to.be.eql(ACTOR_SOURCE_TYPES.SOURCE_FILES);

// eslint-disable-next-line dot-notation
Expand Down Expand Up @@ -212,7 +215,7 @@ describe('[api] apify push', () => {

expect(testActorVersion!.versionNumber).to.be.eql(actorJson.version);
expect(testActorVersion!.envVars).to.be.eql(testActorWithEnvVars.versions[0].envVars);
expect((testActorVersion as any).sourceFiles.sort()).to.be.eql(sourceFiles.sort());
expect((testActorVersion as any).sourceFiles.sort(byName)).to.be.eql(sourceFiles.sort(byName));
expect(testActorVersion!.sourceType).to.be.eql(ACTOR_SOURCE_TYPES.SOURCE_FILES);
},
TEST_TIMEOUT,
Expand Down
Loading