diff --git a/messages/setup.json b/messages/setup.json index 62a59c6..0e45adf 100644 --- a/messages/setup.json +++ b/messages/setup.json @@ -6,7 +6,7 @@ "errorNpmNotFound": "npm command not found. Verify npm is properly installed and try again.", "errorNodeVersion": "Node.js version too low. Version 8.12.0 or higher required. Found version %s", "errorNoPackageJson": "No package.json found at root of project. Run \"npm init\" to create one.", - "errorLwcJestInstall": "Error installing @salesforce/lwc-jest: %o", + "errorLwcJestInstall": "Error installing @salesforce/sfdx-lwc-jest: %o", "logSuccess": "Test setup complete.", "logFileUpdatesStart": "Updating files...", "logFileUpdatesEnd": "File modifications complete.", diff --git a/src/commands/force/lightning/lwc/test/run.ts b/src/commands/force/lightning/lwc/test/run.ts index 9c0b943..eb8905d 100644 --- a/src/commands/force/lightning/lwc/test/run.ts +++ b/src/commands/force/lightning/lwc/test/run.ts @@ -69,7 +69,7 @@ export default class Run extends SfdxCommand { private getExecutablePath() { const projectPath = this.project.getPath(); const nodeModulePath = process.platform === 'win32' ? - path.join('@salesforce', 'lwc-jest', 'bin', 'lwc-jest') : + path.join('@salesforce', 'sfdx-lwc-jest', 'bin', 'lwc-jest') : path.join('.bin', 'lwc-jest'); const executablePath = path.join(projectPath, 'node_modules', nodeModulePath); diff --git a/src/commands/force/lightning/lwc/test/setup.ts b/src/commands/force/lightning/lwc/test/setup.ts index 9023580..276a76f 100644 --- a/src/commands/force/lightning/lwc/test/setup.ts +++ b/src/commands/force/lightning/lwc/test/setup.ts @@ -16,7 +16,7 @@ const testScripts = { 'test:unit:watch': 'lwc-jest --watch' }; -const jestConfig = `const { jestConfig } = require('@salesforce/lwc-jest/config'); +const jestConfig = `const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config'); module.exports = { ...jestConfig, // add any custom configurations here @@ -134,14 +134,14 @@ export default class Setup extends SfdxCommand { } private installLwcJest(): void { - this.ux.log('Installing @salesforce/lwc-jest node package...'); + this.ux.log('Installing @salesforce/sfdx-lwc-jest node package...'); let lwcJestInstallRet; const yarnLockExists = fs.existsSync(path.join(this.project.getPath(), 'yarn.lock')); if (yarnLockExists) { this.ux.log('Detected yarn.lock file, using yarn commands'); - lwcJestInstallRet = spawnSync('yarn', ['add', '--dev', '@salesforce/lwc-jest'], { stdio: 'inherit' }); + lwcJestInstallRet = spawnSync('yarn', ['add', '--dev', '@salesforce/sfdx-lwc-jest'], { stdio: 'inherit' }); } else { - lwcJestInstallRet = spawnSync('npm', ['install', '--save-dev', '@salesforce/lwc-jest'], { stdio: 'inherit' }); + lwcJestInstallRet = spawnSync('npm', ['install', '--save-dev', '@salesforce/sfdx-lwc-jest'], { stdio: 'inherit' }); } if (lwcJestInstallRet.error) { throw new SfdxError(messages.getMessage('errorLwcJestInstall', [lwcJestInstallRet.error.message])); diff --git a/test/commands/lwc/test/setup.test.ts b/test/commands/lwc/test/setup.test.ts index 9b33e95..3022edc 100644 --- a/test/commands/lwc/test/setup.test.ts +++ b/test/commands/lwc/test/setup.test.ts @@ -273,7 +273,7 @@ describe('force:lightning:lwc:test:setup', () => { .command(['force:lightning:lwc:test:setup']) .it('write a jest.config.js file if no existing config found', ctx => { expect(fileWriterStub.queueWrite.args[0][0]).to.contain('jest.config.js'); - expect(fileWriterStub.queueWrite.args[0][1]).to.contain("const { jestConfig } = require('@salesforce/lwc-jest/config'"); + expect(fileWriterStub.queueWrite.args[0][1]).to.contain("const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config'"); }); });