Skip to content

Commit

Permalink
test: windows ut need posix paths in forceignore contents
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 2, 2024
1 parent 0f149cc commit 78ba78c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/resolve/adapters/baseSourceAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { join } from 'node:path';
import { Messages, SfError } from '@salesforce/core';

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

assert.throws(
() => adapterWithIgnore({ path, type }),
Expand Down
3 changes: 2 additions & 1 deletion test/resolve/adapters/matchingContentSourceAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { join } from 'node:path';
import { assert, expect } from 'chai';
import { Messages, SfError } from '@salesforce/core';
import { posixify } from '../../../src/utils/path';
import { getMatchingContentComponent } from '../../../src/resolve/adapters/matchingContentSourceAdapter';
import { matchingContentFile } from '../../mock';
import { ForceIgnore, registry, RegistryAccess, SourceComponent, VirtualTreeContainer } from '../../../src';
Expand Down Expand Up @@ -57,7 +58,7 @@ describe('MatchingContentSourceAdapter', () => {
describe(' forceignore', () => {
it('Should throw an error if content file is forceignored', () => {
const path = CONTENT_PATHS[0];
const forceIgnore = new ForceIgnore('', `${path}`);
const forceIgnore = new ForceIgnore('', `${posixify(path)}`);
const adapter = getMatchingContentComponent({ registry: registryAccess, tree, forceIgnore });
assert.throws(
() => adapter({ path, type }),
Expand Down
6 changes: 5 additions & 1 deletion test/resolve/adapters/mixedContentSourceAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { assert, expect, config } from 'chai';
import { Messages, SfError } from '@salesforce/core';
import { ensureString } from '@salesforce/ts-types';
import { posixify } from '../../../src/utils/path';
import { getMixedContentComponent } from '../../../src/resolve/adapters/mixedContentSourceAdapter';
import { ForceIgnore, registry, RegistryAccess, SourceComponent, VirtualTreeContainer } from '../../../src';
import {
Expand Down Expand Up @@ -44,7 +45,10 @@ describe('MixedContentSourceAdapter', () => {
const adapter = getMixedContentComponent({
registry: registryAccess,
tree,
forceIgnore: new ForceIgnore('', mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS.join('\n')),
forceIgnore: new ForceIgnore(
'',
mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS.map(posixify).join('\n')
),
});

const path = mixedContentDirectory.MIXED_CONTENT_DIRECTORY_SOURCE_PATHS[0];
Expand Down

0 comments on commit 78ba78c

Please sign in to comment.