-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
4,996 additions
and
5,702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,23 @@ jobs: | |
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
package: ./packages/contentstack-clone/package.json | ||
- name: Installing dependencies of import-setup | ||
id: import-setup-installation | ||
if: ${{env.release_releaseAll == 'true' || env.release_plugins_import_setup == 'true'}} | ||
working-directory: ./packages/contentstack-import-setup | ||
run: npm install | ||
- name: Compiling import-setup | ||
if: ${{ steps.import-setup-installation.conclusion == 'success' }} | ||
working-directory: ./packages/contentstack-import-setup | ||
run: npm run prepack | ||
- name: Publishing import-setup | ||
uses: JS-DevTools/[email protected] | ||
if: ${{ steps.import-setup-installation.conclusion == 'success' }} | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
package: ./packages/contentstack-import-setup/package.json | ||
access: public | ||
tag: beta | ||
- name: Installing dependencies of export to csv | ||
id: export-to-csv-installation | ||
if: ${{env.release_releaseAll == 'true' || env.release_plugins_export-to-csv == 'true'}} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
packages/contentstack-audit/test/unit/commands/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import winston from 'winston'; | ||
import { expect, test as fancy } from '@oclif/test'; | ||
import { expect } from 'chai'; | ||
import { runCommand } from '@oclif/test'; | ||
import fancy from 'fancy-test'; | ||
import { FileTransportInstance } from 'winston/lib/winston/transports'; | ||
|
||
import { AuditBaseCommand } from '../../../src/audit-base-command'; | ||
|
||
describe('Audit command', () => { | ||
const fsTransport = class FsTransport { | ||
filename!: string; | ||
} as FileTransportInstance; | ||
|
||
describe('Audit run method', () => { | ||
const test = fancy.loadConfig({ root: process.cwd() }); | ||
test | ||
fancy | ||
.stdout({ print: process.env.PRINT === 'true' || false }) | ||
.stub(winston.transports, 'File', () => fsTransport) | ||
.stub(winston, 'createLogger', () => ({ log: () => {}, error: () => {} })) | ||
.stub(AuditBaseCommand.prototype, 'start', () => {}) | ||
.command(['cm:stacks:audit']) | ||
.it('should trigger AuditBaseCommand start method', ({ stdout }) => { | ||
.it('should trigger AuditBaseCommand start method', async () => { | ||
const { stdout } = await runCommand(['cm:stacks:audit'], { root: process.cwd() }); | ||
expect(stdout).to.be.string; | ||
}); | ||
|
||
test | ||
fancy | ||
.stderr({ print: false }) | ||
.stdout({ print: process.env.PRINT === 'true' || false }) | ||
.stub(winston.transports, 'File', () => fsTransport) | ||
.stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) | ||
.stub(AuditBaseCommand.prototype, 'start', () => Promise.reject('process failed')) | ||
.command(['cm:stacks:audit']) | ||
.exit(1) | ||
.it('should log any error and exit with status code 1'); | ||
.it('should log any error and exit with status code 1', async () => { | ||
await runCommand(['cm:stacks:audit'], { root: process.cwd() }); | ||
}); | ||
|
||
test | ||
fancy | ||
.stderr({ print: false }) | ||
.stdout({ print: process.env.PRINT === 'true' || false }) | ||
.stub(winston.transports, 'File', () => fsTransport) | ||
.stub(winston, 'createLogger', () => ({ log: console.log, error: console.error })) | ||
.stub(AuditBaseCommand.prototype, 'start', () => { | ||
throw Error('process failed'); | ||
}) | ||
.command(['cm:stacks:audit']) | ||
.exit(1) | ||
.it('should log the error objet message and exit with status code 1'); | ||
.it('should log the error objet message and exit with status code 1', async () => { | ||
await runCommand(['cm:stacks:audit'], { root: process.cwd() }); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.