diff --git a/.vscodeignore b/.vscodeignore index 1842ca4d..9b4e1880 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -15,3 +15,4 @@ coverage/ .github out/ !out/extension.js +**/test/** \ No newline at end of file diff --git a/lsp/client/package.json b/lsp/client/package.json index d99b4b69..f08d4584 100644 --- a/lsp/client/package.json +++ b/lsp/client/package.json @@ -3,7 +3,8 @@ "description": "Client for the Salesforce Mobile Language Server, enabling language support for mobile development in VSCode.", "license": "MIT", "version": "0.0.1", - "main": "out/extension.js", + "types": "out/src/extension.d.ts", + "main": "out/src/extension.js", "publisher": "salesforce", "engines": { "vscode": "1.77.0" diff --git a/lsp/client/src/test/diagnostic-gql.test.ts b/lsp/client/test/diagnostic-gql.test.ts similarity index 100% rename from lsp/client/src/test/diagnostic-gql.test.ts rename to lsp/client/test/diagnostic-gql.test.ts diff --git a/lsp/client/src/test/diagnostic-js.test.ts b/lsp/client/test/diagnostic-js.test.ts similarity index 100% rename from lsp/client/src/test/diagnostic-js.test.ts rename to lsp/client/test/diagnostic-js.test.ts diff --git a/lsp/client/src/test/helper.ts b/lsp/client/test/helper.ts similarity index 100% rename from lsp/client/src/test/helper.ts rename to lsp/client/test/helper.ts diff --git a/lsp/client/tsconfig.json b/lsp/client/tsconfig.json index 37ee304a..18277820 100644 --- a/lsp/client/tsconfig.json +++ b/lsp/client/tsconfig.json @@ -4,10 +4,10 @@ "target": "es2020", "lib": ["es2020"], "outDir": "out", - "rootDir": "src", + "rootDir": ".", "sourceMap": true, "composite": true }, - "include": ["src"], + "include": ["src", "test"], "exclude": ["node_modules", ".vscode-test"] } diff --git a/lsp/server/package.json b/lsp/server/package.json index 8e759402..3b1bd255 100644 --- a/lsp/server/package.json +++ b/lsp/server/package.json @@ -6,7 +6,8 @@ "engines": { "node": "*" }, - "main": "out/index.js", + "types": "out/src/index.d.ts", + "main": "out/src/index.js", "publisher": "salesforce", "dependencies": { "@babel/traverse": "^7.25.9", diff --git a/lsp/server/src/index.ts b/lsp/server/src/index.ts index d4fea2a6..1e707cf9 100644 --- a/lsp/server/src/index.ts +++ b/lsp/server/src/index.ts @@ -5,5 +5,5 @@ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT */ -export { TempProjectDirManager } from './test/TestHelper'; +export { TempProjectDirManager } from '../test/TestHelper'; export { CORE_EXTENSION_ID, SFDX_PROJECT_FILE } from './utils/constants'; diff --git a/lsp/server/src/validator/htmlValidator.ts b/lsp/server/src/validator/htmlValidator.ts index 8897b2fd..dff8aea3 100644 --- a/lsp/server/src/validator/htmlValidator.ts +++ b/lsp/server/src/validator/htmlValidator.ts @@ -1,8 +1,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; -import { BaseValidator } from './baseValidator'; - -import { DiagnosticSection } from './baseValidator'; +import { BaseValidator, DiagnosticSection } from './baseValidator'; import { HTMLDocument, getLanguageService } from 'vscode-html-languageservice'; + export class HTMLValidator extends BaseValidator { gatherDiagnosticSections( textDocument: TextDocument diff --git a/lsp/server/src/validator/jsValidator.ts b/lsp/server/src/validator/jsValidator.ts index 52b2e0f7..e98b4a2c 100644 --- a/lsp/server/src/validator/jsValidator.ts +++ b/lsp/server/src/validator/jsValidator.ts @@ -1,8 +1,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; -import { BaseValidator } from './baseValidator'; +import { BaseValidator, DiagnosticSection } from './baseValidator'; import type { Node } from '@babel/types'; import { parseJs } from '../utils/babelUtil'; -import { DiagnosticSection } from './baseValidator'; export class JSValidator extends BaseValidator { gatherDiagnosticSections( diff --git a/lsp/server/src/test/TestHelper.ts b/lsp/server/test/TestHelper.ts similarity index 97% rename from lsp/server/src/test/TestHelper.ts rename to lsp/server/test/TestHelper.ts index bdd0576e..c704199e 100644 --- a/lsp/server/src/test/TestHelper.ts +++ b/lsp/server/test/TestHelper.ts @@ -11,14 +11,14 @@ import * as os from 'os'; import * as path from 'path'; import * as process from 'process'; import * as sinon from 'sinon'; -import Account from '../../testFixture/objectInfos/Account.json'; +import Account from '../testFixture/objectInfos/Account.json'; import { ConfigAggregator, StateAggregator, Connection, AuthInfo } from '@salesforce/core'; -import { WorkspaceUtils } from '../utils/workspaceUtils'; +import { WorkspaceUtils } from '../src/utils/workspaceUtils'; const testOrgConfig = { key: 'target-org', diff --git a/lsp/server/src/test/diagnostic/gql/over-sized-record.test.ts b/lsp/server/test/diagnostic/gql/over-sized-record.test.ts similarity index 95% rename from lsp/server/src/test/diagnostic/gql/over-sized-record.test.ts rename to lsp/server/test/diagnostic/gql/over-sized-record.test.ts index 75914e98..b2ec9707 100644 --- a/lsp/server/src/test/diagnostic/gql/over-sized-record.test.ts +++ b/lsp/server/test/diagnostic/gql/over-sized-record.test.ts @@ -7,7 +7,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { suite, test, beforeEach, afterEach } from 'mocha'; -import Book__c from '../../../../testFixture/objectInfos/Book__c.json'; +import Book__c from '../../../testFixture/objectInfos/Book__c.json'; import * as assert from 'assert'; import * as sinon from 'sinon'; @@ -16,10 +16,10 @@ import { OversizedRecord, OVER_SIZED_FIELD_MESSAGE, OVER_SIZED_RECORD_MESSAGE -} from '../../../diagnostic/gql/over-sized-record'; -import { OrgUtils } from '../../../utils/orgUtils'; +} from '../../../src/diagnostic/gql/over-sized-record'; +import { OrgUtils } from '../../../src/utils/orgUtils'; -import { ObjectInfoRepresentation } from '../../../types'; +import { ObjectInfoRepresentation } from '../../../src/types'; suite( 'GraphQL Diagnostics Test Suite - Server - Oversized GraphQL Field', diff --git a/lsp/server/src/test/diagnostic/js/adapters-local-change-not-aware.test.ts b/lsp/server/test/diagnostic/js/adapters-local-change-not-aware.test.ts similarity index 96% rename from lsp/server/src/test/diagnostic/js/adapters-local-change-not-aware.test.ts rename to lsp/server/test/diagnostic/js/adapters-local-change-not-aware.test.ts index b51eb6d9..abde5b2f 100644 --- a/lsp/server/src/test/diagnostic/js/adapters-local-change-not-aware.test.ts +++ b/lsp/server/test/diagnostic/js/adapters-local-change-not-aware.test.ts @@ -15,8 +15,8 @@ import { URL_FOR_GET_RELATED_LIST_RECORDS_EXTERNAL_DOC, MESSAGE_FOR_GET_RELATED_LIST_RECORDS, MESSAGE_FOR_GET_RELATED_LIST_COUNT -} from '../../../diagnostic/js/adapters-local-change-not-aware'; -import { parseJs } from '../../../utils/babelUtil'; +} from '../../../src/diagnostic/js/adapters-local-change-not-aware'; +import { parseJs } from '../../../src/utils/babelUtil'; import { TextDocument } from 'vscode-languageserver-textdocument'; suite( diff --git a/lsp/server/src/test/utils/babelUtil.test.ts b/lsp/server/test/utils/babelUtil.test.ts similarity index 95% rename from lsp/server/src/test/utils/babelUtil.test.ts rename to lsp/server/test/utils/babelUtil.test.ts index 18054f4f..cd40b74c 100644 --- a/lsp/server/src/test/utils/babelUtil.test.ts +++ b/lsp/server/test/utils/babelUtil.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { suite, test, afterEach } from 'mocha'; -import { parseJs } from '../../utils/babelUtil'; +import { parseJs } from '../../src/utils/babelUtil'; suite('BabelUtil Test Suite - Server', () => { afterEach(function () { diff --git a/lsp/server/src/test/utils/gqlUtils.test.ts b/lsp/server/test/utils/gqlUtils.test.ts similarity index 92% rename from lsp/server/src/test/utils/gqlUtils.test.ts rename to lsp/server/test/utils/gqlUtils.test.ts index 990042ce..c7e20fbc 100644 --- a/lsp/server/src/test/utils/gqlUtils.test.ts +++ b/lsp/server/test/utils/gqlUtils.test.ts @@ -7,19 +7,19 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { suite, test, beforeEach, afterEach } from 'mocha'; -import Account from '../../../testFixture/objectInfos/Account.json'; -import User from '../../../testFixture/objectInfos/User.json'; -import Contact from '../../../testFixture/objectInfos/Contact.json'; +import Account from '../../testFixture/objectInfos/Account.json'; +import User from '../../testFixture/objectInfos/User.json'; +import Contact from '../../testFixture/objectInfos/Contact.json'; import * as assert from 'assert'; import * as sinon from 'sinon'; import { parse } from 'graphql'; -import { OrgUtils } from '../../utils/orgUtils'; -import { generateEntityTree } from '../../utils/gqlUtils'; -import { OperationNode, Relation } from '../../utils/gqlUtils'; +import { OrgUtils } from '../../src/utils/orgUtils'; +import { generateEntityTree } from '../../src/utils/gqlUtils'; +import { OperationNode, Relation } from '../../src/utils/gqlUtils'; -import { ObjectInfoRepresentation } from '../../types'; +import { ObjectInfoRepresentation } from '../../src/types'; suite('GraphQL Utils Test Suite - Server', () => { let sandbox: sinon.SinonSandbox; beforeEach(function () { diff --git a/lsp/server/src/test/utils/orgUtils.test.ts b/lsp/server/test/utils/orgUtils.test.ts similarity index 97% rename from lsp/server/src/test/utils/orgUtils.test.ts rename to lsp/server/test/utils/orgUtils.test.ts index a7ed6274..ab37bce3 100644 --- a/lsp/server/src/test/utils/orgUtils.test.ts +++ b/lsp/server/test/utils/orgUtils.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { suite, test, beforeEach, afterEach } from 'mocha'; -import { OrgUtils } from '../../utils/orgUtils'; +import { OrgUtils } from '../../src/utils/orgUtils'; import { setupTempWorkspaceDirectoryStub, @@ -17,7 +17,7 @@ import { stubGetInstanceState, stubCreateConfig } from '../TestHelper'; -import { ObjectInfoRepresentation } from '../../types'; +import { ObjectInfoRepresentation } from '../../src/types'; suite('OrgUtils Test Suite - Server', () => { let sandbox: sinon.SinonSandbox; diff --git a/lsp/server/src/test/utils/workspaceUtils.test.ts b/lsp/server/test/utils/workspaceUtils.test.ts similarity index 93% rename from lsp/server/src/test/utils/workspaceUtils.test.ts rename to lsp/server/test/utils/workspaceUtils.test.ts index e279d401..803d6766 100644 --- a/lsp/server/src/test/utils/workspaceUtils.test.ts +++ b/lsp/server/test/utils/workspaceUtils.test.ts @@ -9,14 +9,14 @@ import * as assert from 'assert'; import * as path from 'path'; import * as fs from 'fs'; import { mkdir } from 'fs/promises'; -import { WorkspaceUtils } from '../../utils/workspaceUtils'; +import { WorkspaceUtils } from '../../src/utils/workspaceUtils'; import { TempProjectDirManager, setupTempWorkspaceDirectoryStub } from '../TestHelper'; import { suite, test, afterEach, beforeEach } from 'mocha'; import * as sinon from 'sinon'; -import { SFDX_PROJECT_FILE } from '../../utils/constants'; +import { SFDX_PROJECT_FILE } from '../../src/utils/constants'; suite('Workspace Test Suite - Server', () => { let getWorkspaceDirStub: sinon.SinonStub<[], string>; diff --git a/lsp/server/src/test/utils/yamlParser.test.ts b/lsp/server/test/utils/yamlParser.test.ts similarity index 97% rename from lsp/server/src/test/utils/yamlParser.test.ts rename to lsp/server/test/utils/yamlParser.test.ts index a126622e..28cd8acb 100644 --- a/lsp/server/src/test/utils/yamlParser.test.ts +++ b/lsp/server/test/utils/yamlParser.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { suite, test, afterEach } from 'mocha'; -import { transformYamlToObject } from '../../utils/yamlParser'; +import { transformYamlToObject } from '../../src/utils/yamlParser'; suite('YamlParser Test Suite', () => { afterEach(function () { diff --git a/lsp/server/src/test/validator/graphqlValidator.test.ts b/lsp/server/test/validator/graphqlValidator.test.ts similarity index 90% rename from lsp/server/src/test/validator/graphqlValidator.test.ts rename to lsp/server/test/validator/graphqlValidator.test.ts index 7745b102..6fdc1569 100644 --- a/lsp/server/src/test/validator/graphqlValidator.test.ts +++ b/lsp/server/test/validator/graphqlValidator.test.ts @@ -6,18 +6,18 @@ */ import { TextDocument } from 'vscode-languageserver-textdocument'; -import { GraphQLValidator } from '../../validator/gqlValidator'; +import { GraphQLValidator } from '../../src/validator/gqlValidator'; import { OversizedRecord, RULE_ID -} from '../../diagnostic/gql/over-sized-record'; +} from '../../src/diagnostic/gql/over-sized-record'; import * as assert from 'assert'; import { suite, test, beforeEach, afterEach } from 'mocha'; import * as sinon from 'sinon'; -import { OrgUtils } from '../../utils/orgUtils'; -import Book__c from '../../../testFixture/objectInfos/Book__c.json'; -import { ObjectInfoRepresentation } from '../../types'; +import { OrgUtils } from '../../src/utils/orgUtils'; +import Book__c from '../../testFixture/objectInfos/Book__c.json'; +import { ObjectInfoRepresentation } from '../../src/types'; suite('Diagnostics Test Suite - Server - GraphQL Validator', () => { let sandbox: sinon.SinonSandbox; diff --git a/lsp/server/src/test/validator/htmlValidator.test.ts b/lsp/server/test/validator/htmlValidator.test.ts similarity index 95% rename from lsp/server/src/test/validator/htmlValidator.test.ts rename to lsp/server/test/validator/htmlValidator.test.ts index cb8ffd12..6744eeb4 100644 --- a/lsp/server/src/test/validator/htmlValidator.test.ts +++ b/lsp/server/test/validator/htmlValidator.test.ts @@ -7,12 +7,12 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { suite, test } from 'mocha'; -import { HTMLValidator } from '../../validator/htmlValidator'; +import { HTMLValidator } from '../../src/validator/htmlValidator'; import * as assert from 'assert'; import { MobileOfflineFriendly, RULE_ID -} from '../../diagnostic/html/mobileOfflineFriendly'; +} from '../../src/diagnostic/html/mobileOfflineFriendly'; suite('Diagnostics Test Suite - Server - HTML Validator', () => { const htmlValidator: HTMLValidator = new HTMLValidator(); diff --git a/lsp/server/src/test/validator/jsValidator.test.ts b/lsp/server/test/validator/jsValidator.test.ts similarity index 95% rename from lsp/server/src/test/validator/jsValidator.test.ts rename to lsp/server/test/validator/jsValidator.test.ts index 3c6e5c1f..233ecc17 100644 --- a/lsp/server/src/test/validator/jsValidator.test.ts +++ b/lsp/server/test/validator/jsValidator.test.ts @@ -9,12 +9,12 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import * as assert from 'assert'; import { suite, test } from 'mocha'; -import { JSValidator } from '../../validator/jsValidator'; +import { JSValidator } from '../../src/validator/jsValidator'; import { AdaptersLocalChangeNotAware, MESSAGE_FOR_GET_RELATED_LIST_RECORDS, RULE_ID -} from '../../diagnostic/js/adapters-local-change-not-aware'; +} from '../../src/diagnostic/js/adapters-local-change-not-aware'; suite('Diagnostics Test Suite - Server - JS Validator', () => { const jsValidator = new JSValidator(); diff --git a/lsp/server/src/test/validatorManager.test.ts b/lsp/server/test/validatorManager.test.ts similarity index 90% rename from lsp/server/src/test/validatorManager.test.ts rename to lsp/server/test/validatorManager.test.ts index 2b6e127e..b77085ff 100644 --- a/lsp/server/src/test/validatorManager.test.ts +++ b/lsp/server/test/validatorManager.test.ts @@ -9,8 +9,8 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import * as assert from 'assert'; import { suite, test } from 'mocha'; -import { ValidatorManager } from '../validatorManager'; -import { MESSAGE_FOR_GET_RELATED_LIST_RECORDS } from '../diagnostic/js/adapters-local-change-not-aware'; +import { ValidatorManager } from '../src/validatorManager'; +import { MESSAGE_FOR_GET_RELATED_LIST_RECORDS } from '../src/diagnostic/js/adapters-local-change-not-aware'; suite('Diagnostics Test Suite - Server - ValidatorManager', () => { const validatorManager = ValidatorManager.createInstance(); diff --git a/lsp/server/tsconfig.json b/lsp/server/tsconfig.json index ef026e5b..64211877 100644 --- a/lsp/server/tsconfig.json +++ b/lsp/server/tsconfig.json @@ -9,10 +9,9 @@ "sourceMap": true, "strict": true, "outDir": "out", - "rootDir": "src", + "rootDir": ".", "composite": true }, - - "include": ["src"], + "include": ["src", "test", "testFixture/**/*.json"], "exclude": ["node_modules"] } diff --git a/package.json b/package.json index 4e264af6..2db5094f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "extensionDependencies": [ "salesforce.salesforcedx-vscode-core" ], - "main": "out/extension.js", + "main": "out/src/extension.js", "l10n": "./l10n", "contributes": { "menus": { @@ -95,7 +95,7 @@ "scripts": { "clean": "rimraf out ./lsp/server/out ./lsp/client/out", "compile": "rimraf ./lsp/server/tsconfig.tsbuildinfo ./lsp/client/tsconfig.tsbuildinfo && tsc -b ./ && npm run copy-resources", - "copy-resources": "cp -r './lsp/server/resources' './lsp/server/out/'", + "copy-resources": "cp -r './lsp/server/resources' './lsp/server/out/src/'", "watch": "tsc -watch -b ./", "pretest": "npm run compile && npm run lint", "lint": "eslint src --ext ts", diff --git a/src/test/TestHelper.ts b/test/TestHelper.ts similarity index 95% rename from src/test/TestHelper.ts rename to test/TestHelper.ts index 7cd64466..6700c3e1 100644 --- a/src/test/TestHelper.ts +++ b/test/TestHelper.ts @@ -8,7 +8,7 @@ import * as path from 'path'; import * as process from 'process'; import * as sinon from 'sinon'; -import { WorkspaceUtils } from '../utils/workspaceUtils'; +import { WorkspaceUtils } from '../src/utils/workspaceUtils'; import { TempProjectDirManager } from 'mobile-lsp-server'; export { TempProjectDirManager }; @@ -34,4 +34,4 @@ export function setupTempWorkspaceDirectoryStub( const getWorkspaceDirStub = sinon.stub(WorkspaceUtils, 'getWorkspaceDir'); getWorkspaceDirStub.returns(projectDirManager.projectDir); return getWorkspaceDirStub; -} +} \ No newline at end of file diff --git a/src/test/runTest.ts b/test/runTest.ts similarity index 97% rename from src/test/runTest.ts rename to test/runTest.ts index 6cd72179..f41279d4 100644 --- a/src/test/runTest.ts +++ b/test/runTest.ts @@ -13,7 +13,7 @@ import { runTests } from '@vscode/test-electron'; import { spawnSync } from 'child_process'; -import { CORE_EXTENSION_ID } from '../utils/constants'; +import { CORE_EXTENSION_ID } from '../src/utils/constants'; const VSCODE_TEST_VERSION = 'stable'; diff --git a/src/test/suite/commands/lint/configureLintingToolsCommand.test.ts b/test/suite/commands/lint/configureLintingToolsCommand.test.ts similarity index 96% rename from src/test/suite/commands/lint/configureLintingToolsCommand.test.ts rename to test/suite/commands/lint/configureLintingToolsCommand.test.ts index 7927a663..1966edd5 100644 --- a/src/test/suite/commands/lint/configureLintingToolsCommand.test.ts +++ b/test/suite/commands/lint/configureLintingToolsCommand.test.ts @@ -11,8 +11,8 @@ import * as path from 'path'; import * as fs from 'fs'; import { window } from 'vscode'; import { afterEach } from 'mocha'; -import { ConfigureLintingToolsCommand } from '../../../../commands/lint/configureLintingToolsCommand'; -import { WorkspaceUtils } from '../../../../utils/workspaceUtils'; +import { ConfigureLintingToolsCommand } from '../../../../src/commands/lint/configureLintingToolsCommand'; +import { WorkspaceUtils } from '../../../../src/utils/workspaceUtils'; import { TempProjectDirManager, setupTempWorkspaceDirectoryStub @@ -147,7 +147,7 @@ suite('Configure Linting Tools Command Test Suite', () => { devDependencies: { lwc: '1.2.3', // eslint-disable-next-line @typescript-eslint/naming-convention - '@salesforce/eslint-plugin-lwc-mobile': '^1.0.0', + "@salesforce/eslint-plugin-lwc-mobile":"^1.0.0", // eslint-disable-next-line @typescript-eslint/naming-convention '@salesforce/eslint-plugin-lwc-graph-analyzer': '^0.9.0', eslint: '^8.47.0' diff --git a/src/test/suite/commands/wizard/authorizeToOrgCommand.test.ts b/test/suite/commands/wizard/authorizeToOrgCommand.test.ts similarity index 94% rename from src/test/suite/commands/wizard/authorizeToOrgCommand.test.ts rename to test/suite/commands/wizard/authorizeToOrgCommand.test.ts index 023c0868..e72f2d1b 100644 --- a/src/test/suite/commands/wizard/authorizeToOrgCommand.test.ts +++ b/test/suite/commands/wizard/authorizeToOrgCommand.test.ts @@ -9,8 +9,8 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { commands, window } from 'vscode'; import { afterEach } from 'mocha'; -import { AuthorizeCommand } from '../../../../commands/wizard/authorizeCommand'; -import { OrgUtils } from '../../../../utils/orgUtils'; +import { AuthorizeCommand } from '../../../../src/commands/wizard/authorizeCommand'; +import { OrgUtils } from '../../../../src/utils/orgUtils'; suite('Authorize Org Command Test Suite', () => { afterEach(function () { diff --git a/src/test/suite/commands/wizard/briefcaseCommand.test.ts b/test/suite/commands/wizard/briefcaseCommand.test.ts similarity index 94% rename from src/test/suite/commands/wizard/briefcaseCommand.test.ts rename to test/suite/commands/wizard/briefcaseCommand.test.ts index 166a950f..8a2851a5 100644 --- a/src/test/suite/commands/wizard/briefcaseCommand.test.ts +++ b/test/suite/commands/wizard/briefcaseCommand.test.ts @@ -8,10 +8,10 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { afterEach, beforeEach } from 'mocha'; -import { BriefcaseCommand } from '../../../../commands/wizard/briefcaseCommand'; +import { BriefcaseCommand } from '../../../../src/commands/wizard/briefcaseCommand'; import { Uri, l10n, window, Progress, CancellationToken } from 'vscode'; import { CommonUtils } from '@salesforce/lwc-dev-mobile-core/lib/common/CommonUtils'; -import { InstructionsWebviewProvider } from '../../../../webviews/instructions'; +import { InstructionsWebviewProvider } from '../../../../src/webviews/instructions'; suite('Briefcase Command Test Suite', () => { beforeEach(function () {}); diff --git a/src/test/suite/commands/wizard/configureProjectCommand.test.ts b/test/suite/commands/wizard/configureProjectCommand.test.ts similarity index 99% rename from src/test/suite/commands/wizard/configureProjectCommand.test.ts rename to test/suite/commands/wizard/configureProjectCommand.test.ts index fa243938..6a601ab9 100644 --- a/src/test/suite/commands/wizard/configureProjectCommand.test.ts +++ b/test/suite/commands/wizard/configureProjectCommand.test.ts @@ -17,7 +17,7 @@ import { ConfigureProjectCommand, DefaultProjectConfigurationProcessor, ProjectConfigurationProcessor -} from '../../../../commands/wizard/configureProjectCommand'; +} from '../../../../src/commands/wizard/configureProjectCommand'; import { TempProjectDirManager, createPlatformAbsolutePath diff --git a/src/test/suite/commands/wizard/deployToOrgCommand.test.ts b/test/suite/commands/wizard/deployToOrgCommand.test.ts similarity index 96% rename from src/test/suite/commands/wizard/deployToOrgCommand.test.ts rename to test/suite/commands/wizard/deployToOrgCommand.test.ts index 52636180..d52cb57b 100644 --- a/src/test/suite/commands/wizard/deployToOrgCommand.test.ts +++ b/test/suite/commands/wizard/deployToOrgCommand.test.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { afterEach } from 'mocha'; import { Uri, commands, window, workspace } from 'vscode'; -import { DeployToOrgCommand } from '../../../../commands/wizard/deployToOrgCommand'; +import { DeployToOrgCommand } from '../../../../src/commands/wizard/deployToOrgCommand'; suite('Deploy To Org Command Test Suite', () => { afterEach(function () { diff --git a/src/test/suite/commands/wizard/landingPageCommand.test.ts b/test/suite/commands/wizard/landingPageCommand.test.ts similarity index 95% rename from src/test/suite/commands/wizard/landingPageCommand.test.ts rename to test/suite/commands/wizard/landingPageCommand.test.ts index 96b73606..acd00f3e 100644 --- a/src/test/suite/commands/wizard/landingPageCommand.test.ts +++ b/test/suite/commands/wizard/landingPageCommand.test.ts @@ -8,13 +8,13 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import * as vscode from 'vscode'; -import { OrgUtils, SObject } from '../../../../utils/orgUtils'; +import { OrgUtils, SObject } from '../../../../src/utils/orgUtils'; import { SinonStub } from 'sinon'; import { afterEach, beforeEach } from 'mocha'; -import { UIUtils } from '../../../../utils/uiUtils'; -import { UEMBuilder } from '../../../../utils/uemBuilder'; +import { UIUtils } from '../../../../src/utils/uiUtils'; +import { UEMBuilder } from '../../../../src/utils/uemBuilder'; import { QuickPickItem } from 'vscode'; -import { LandingPageCommand } from '../../../../commands/wizard/landingPageCommand'; +import { LandingPageCommand } from '../../../../src/commands/wizard/landingPageCommand'; suite('Landing Page Command Test Suite', () => { let originalShowQuickPickFunction: ( diff --git a/src/test/suite/commands/wizard/lwcGenerationCommand.test.ts b/test/suite/commands/wizard/lwcGenerationCommand.test.ts similarity index 96% rename from src/test/suite/commands/wizard/lwcGenerationCommand.test.ts rename to test/suite/commands/wizard/lwcGenerationCommand.test.ts index a49658af..ec6e1898 100644 --- a/src/test/suite/commands/wizard/lwcGenerationCommand.test.ts +++ b/test/suite/commands/wizard/lwcGenerationCommand.test.ts @@ -13,13 +13,12 @@ import { afterEach, beforeEach } from 'mocha'; import { LwcGenerationCommand, SObjectQuickActionStatus -} from '../../../../commands/wizard/lwcGenerationCommand'; -import { WorkspaceUtils } from '../../../../utils/workspaceUtils'; +} from '../../../../src/commands/wizard/lwcGenerationCommand'; +import { WorkspaceUtils } from '../../../../src/utils/workspaceUtils'; import { TempProjectDirManager } from '../../../TestHelper'; import { Uri } from 'vscode'; -import { CompactLayoutField, OrgUtils } from '../../../../utils/orgUtils'; -import { CodeBuilder } from '../../../../utils/codeBuilder'; -import { create } from 'domain'; +import { CompactLayoutField, OrgUtils } from '../../../../src/utils/orgUtils'; +import { CodeBuilder } from '../../../../src/utils/codeBuilder'; suite('LWC Generation Command Test Suite', () => { let sandbox: sinon.SinonSandbox; diff --git a/src/test/suite/commands/wizard/templateChooserCommand.test.ts b/test/suite/commands/wizard/templateChooserCommand.test.ts similarity index 98% rename from src/test/suite/commands/wizard/templateChooserCommand.test.ts rename to test/suite/commands/wizard/templateChooserCommand.test.ts index 76378fb9..22eb67f5 100644 --- a/src/test/suite/commands/wizard/templateChooserCommand.test.ts +++ b/test/suite/commands/wizard/templateChooserCommand.test.ts @@ -14,10 +14,9 @@ import { afterEach, beforeEach } from 'mocha'; import { TemplateChooserCommand, LandingPageType -} from '../../../../commands/wizard/templateChooserCommand'; +} from '../../../../src/commands/wizard/templateChooserCommand'; import { TempProjectDirManager } from '../../../TestHelper'; -import { UIUtils } from '../../../../utils/uiUtils'; -import { WorkspaceUtils } from '../../../../utils/workspaceUtils'; +import { WorkspaceUtils } from '../../../../src/utils/workspaceUtils'; type LandingPageTestIOConfig = { [landingPageType in LandingPageType]?: { diff --git a/src/test/suite/extension.test.ts b/test/suite/extension.test.ts similarity index 100% rename from src/test/suite/extension.test.ts rename to test/suite/extension.test.ts diff --git a/src/test/suite/index.ts b/test/suite/index.ts similarity index 100% rename from src/test/suite/index.ts rename to test/suite/index.ts diff --git a/src/test/suite/utils/codeBuilder.test.ts b/test/suite/utils/codeBuilder.test.ts similarity index 99% rename from src/test/suite/utils/codeBuilder.test.ts rename to test/suite/utils/codeBuilder.test.ts index b084ba55..43f99f75 100644 --- a/src/test/suite/utils/codeBuilder.test.ts +++ b/test/suite/utils/codeBuilder.test.ts @@ -7,12 +7,12 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; -import { CodeBuilder } from '../../../utils/codeBuilder'; +import { CodeBuilder } from '../../../src/utils/codeBuilder'; import { Uri } from 'vscode'; import { afterEach, beforeEach } from 'mocha'; import * as fs from 'fs'; import * as path from 'path'; -import { CompactLayoutField } from '../../../utils/orgUtils'; +import { CompactLayoutField } from '../../../src/utils/orgUtils'; suite('CodeBuilder Test Suite', () => { var extensionUri = Uri.parse('file:///tmp/'); diff --git a/src/test/suite/utils/orgUtils.test.ts b/test/suite/utils/orgUtils.test.ts similarity index 99% rename from src/test/suite/utils/orgUtils.test.ts rename to test/suite/utils/orgUtils.test.ts index cc8950f6..15a595eb 100644 --- a/src/test/suite/utils/orgUtils.test.ts +++ b/test/suite/utils/orgUtils.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; -import { OrgUtils } from '../../../utils/orgUtils'; +import { OrgUtils } from '../../../src/utils/orgUtils'; import { SinonStub } from 'sinon'; import { afterEach, beforeEach } from 'mocha'; import { @@ -20,7 +20,7 @@ import { DescribeSObjectResult, Field as FieldType } from 'jsforce'; -import { CoreExtensionService } from '../../../services'; +import { CoreExtensionService } from '../../../src/services'; suite('Org Utils Test Suite', () => { const describeGlobalResult: DescribeGlobalResult = { diff --git a/src/test/suite/utils/uemBuilder.test.ts b/test/suite/utils/uemBuilder.test.ts similarity index 96% rename from src/test/suite/utils/uemBuilder.test.ts rename to test/suite/utils/uemBuilder.test.ts index 46560b44..68779dec 100644 --- a/src/test/suite/utils/uemBuilder.test.ts +++ b/test/suite/utils/uemBuilder.test.ts @@ -6,8 +6,8 @@ */ import * as assert from 'assert'; -import { UEMBuilder } from '../../../utils/uemBuilder'; -import { Field } from '../../../utils/orgUtils'; +import { UEMBuilder } from '../../../src/utils/uemBuilder'; +import { Field } from '../../../src/utils/orgUtils'; suite('UEM Builder Test Suite', () => { test('Build returns default with no cards', async () => { diff --git a/src/test/suite/utils/uemParser.test.ts b/test/suite/utils/uemParser.test.ts similarity index 98% rename from src/test/suite/utils/uemParser.test.ts rename to test/suite/utils/uemParser.test.ts index 1e35c985..f8eb1aea 100644 --- a/src/test/suite/utils/uemParser.test.ts +++ b/test/suite/utils/uemParser.test.ts @@ -6,7 +6,7 @@ */ import * as assert from 'assert'; -import { UEMParser } from '../../../utils/uemParser'; +import { UEMParser } from '../../../src/utils/uemParser'; suite('UEM Parser Test Suite', () => { test('Empty object returns empty array', async () => { diff --git a/src/test/suite/utils/uiUtils.test.ts b/test/suite/utils/uiUtils.test.ts similarity index 98% rename from src/test/suite/utils/uiUtils.test.ts rename to test/suite/utils/uiUtils.test.ts index 4aca6e7c..6967d559 100644 --- a/src/test/suite/utils/uiUtils.test.ts +++ b/test/suite/utils/uiUtils.test.ts @@ -6,7 +6,7 @@ */ import * as assert from 'assert'; -import { UIUtils } from '../../../utils/uiUtils'; +import { UIUtils } from '../../../src/utils/uiUtils'; import { QuickPickItem, window, QuickPick } from 'vscode'; import { afterEach, beforeEach } from 'mocha'; import * as sinon from 'sinon'; diff --git a/src/test/suite/utils/workspaceUtils.test.ts b/test/suite/utils/workspaceUtils.test.ts similarity index 97% rename from src/test/suite/utils/workspaceUtils.test.ts rename to test/suite/utils/workspaceUtils.test.ts index 96d8fd97..ffcb958d 100644 --- a/src/test/suite/utils/workspaceUtils.test.ts +++ b/test/suite/utils/workspaceUtils.test.ts @@ -13,14 +13,14 @@ import { NoStaticResourcesDirError, NoWorkspaceError, WorkspaceUtils -} from '../../../utils/workspaceUtils'; +} from '../../../src/utils/workspaceUtils'; import { TempProjectDirManager, setupTempWorkspaceDirectoryStub } from '../../TestHelper'; import { afterEach, beforeEach } from 'mocha'; import * as sinon from 'sinon'; -import { SFDX_PROJECT_FILE } from '../../../utils/constants'; +import { SFDX_PROJECT_FILE } from '../../../src/utils/constants'; suite('Workspace Test Suite', () => { let getWorkspaceDirStub: sinon.SinonStub<[], string>; diff --git a/src/test/suite/webviews.test.ts b/test/suite/webviews.test.ts similarity index 99% rename from src/test/suite/webviews.test.ts rename to test/suite/webviews.test.ts index c7d420fe..fa60bae6 100644 --- a/src/test/suite/webviews.test.ts +++ b/test/suite/webviews.test.ts @@ -15,7 +15,7 @@ import { join } from 'node:path'; import { WebviewMessageHandler, WebviewProcessor -} from '../../webviews/processor'; +} from '../../src/webviews/processor'; import { TempProjectDirManager } from '../TestHelper'; suite('Webview Test Suite', () => { diff --git a/tsconfig.json b/tsconfig.json index b21d5fe8..7a684607 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "out", "lib": ["es2020"], "sourceMap": true, - "rootDir": "src", + "rootDir": ".", "strict": true /* enable all strict type-checking options */ /* Additional Checks */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ @@ -13,7 +13,7 @@ // "noUnusedParameters": true, /* Report errors on unused parameters. */ }, - "include": ["src"], + "include": ["src", "test"], "references": [ { "path": "./lsp/client" }, { "path": "./lsp/server" }