Skip to content

Commit 78ba78c

Browse files
committed
test: windows ut need posix paths in forceignore contents
1 parent 0f149cc commit 78ba78c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

test/resolve/adapters/baseSourceAdapter.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { join } from 'node:path';
88
import { Messages, SfError } from '@salesforce/core';
99

1010
import { assert, expect } from 'chai';
11+
import { posixify } from '../../../src/utils/path';
1112
import { decomposed, mixedContentSingleFile, nestedTypes, xmlInFolder, document } from '../../mock';
1213
import { getComponent } from '../../../src/resolve/adapters/baseSourceAdapter';
1314
import { META_XML_SUFFIX } from '../../../src/common';
@@ -55,7 +56,7 @@ describe('BaseSourceAdapter', () => {
5556
it('should throw an error if a metadata xml file is forceignored', () => {
5657
const type = registry.getRegistry().types.apexclass;
5758
const path = join('path', 'to', type.directoryName, `My_Test.${type.suffix}${META_XML_SUFFIX}`);
58-
const adapterWithIgnore = getComponent({ tree, registry, forceIgnore: new ForceIgnore('', `${path}`) });
59+
const adapterWithIgnore = getComponent({ tree, registry, forceIgnore: new ForceIgnore('', posixify(path)) });
5960

6061
assert.throws(
6162
() => adapterWithIgnore({ path, type }),

test/resolve/adapters/matchingContentSourceAdapter.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { join } from 'node:path';
88
import { assert, expect } from 'chai';
99
import { Messages, SfError } from '@salesforce/core';
10+
import { posixify } from '../../../src/utils/path';
1011
import { getMatchingContentComponent } from '../../../src/resolve/adapters/matchingContentSourceAdapter';
1112
import { matchingContentFile } from '../../mock';
1213
import { ForceIgnore, registry, RegistryAccess, SourceComponent, VirtualTreeContainer } from '../../../src';
@@ -57,7 +58,7 @@ describe('MatchingContentSourceAdapter', () => {
5758
describe(' forceignore', () => {
5859
it('Should throw an error if content file is forceignored', () => {
5960
const path = CONTENT_PATHS[0];
60-
const forceIgnore = new ForceIgnore('', `${path}`);
61+
const forceIgnore = new ForceIgnore('', `${posixify(path)}`);
6162
const adapter = getMatchingContentComponent({ registry: registryAccess, tree, forceIgnore });
6263
assert.throws(
6364
() => adapter({ path, type }),

test/resolve/adapters/mixedContentSourceAdapter.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { assert, expect, config } from 'chai';
88
import { Messages, SfError } from '@salesforce/core';
99
import { ensureString } from '@salesforce/ts-types';
10+
import { posixify } from '../../../src/utils/path';
1011
import { getMixedContentComponent } from '../../../src/resolve/adapters/mixedContentSourceAdapter';
1112
import { ForceIgnore, registry, RegistryAccess, SourceComponent, VirtualTreeContainer } from '../../../src';
1213
import {
@@ -44,7 +45,10 @@ describe('MixedContentSourceAdapter', () => {
4445
const adapter = getMixedContentComponent({
4546
registry: registryAccess,
4647
tree,
47-
forceIgnore: new ForceIgnore('', mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS.join('\n')),
48+
forceIgnore: new ForceIgnore(
49+
'',
50+
mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS.map(posixify).join('\n')
51+
),
4852
});
4953

5054
const path = mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS[0];

0 commit comments

Comments
 (0)