Skip to content

Commit 45c20e4

Browse files
test: add logging
1 parent 10344bc commit 45c20e4

File tree

2 files changed

+6
-51
lines changed

2 files changed

+6
-51
lines changed

README.md

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,7 @@
1-
**NOTE: This template for sf plugins is not yet official. Please consult with the Platform CLI team before using this template.**
2-
3-
# plugin-template-sf
4-
5-
[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-template-sf.svg?label=@salesforce/plugin-template-sf)](https://www.npmjs.com/package/@salesforce/plugin-template-sf) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-template-sf.svg)](https://npmjs.org/package/@salesforce/plugin-template-sf) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-template-sf/main/LICENSE.txt)
6-
7-
## Using the template
8-
9-
This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
10-
11-
1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
12-
2. Generate your plugin:
13-
14-
```
15-
sf plugins install dev
16-
sf dev generate plugin
17-
18-
git init -b main
19-
git add . && git commit -m "chore: initial commit"
20-
```
21-
22-
3. Create your plugin's repo in the salesforcecli github org
23-
4. When you're ready, replace the contents of this README with the information you want.
24-
25-
## Learn about `sf` plugins
26-
27-
Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
28-
29-
This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce. There is also a default circleci config using the [release management orb](https://github.com/forcedotcom/npm-release-management-orb) standards.
30-
31-
Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled.
32-
33-
### Tooling
34-
35-
- [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
36-
- [@salesforce/kit](https://github.com/forcedotcom/kit)
37-
- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
38-
- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
39-
- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
40-
- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
41-
- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
42-
43-
# Everything past here is only a suggestion as to what should be in your specific plugin's description
44-
45-
This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
46-
47-
We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
48-
491
## Install
502

513
```bash
52-
sf plugins install @salesforce/plugin-template-sf@x.y.z
4+
sf plugins install @salesforce/plugin-api
535
```
546

557
## Issues

test/commands/api/request/graphql.nut.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import { join } from 'node:path';
99
import fs from 'node:fs';
10+
import * as util from 'node:util';
1011
import { config, expect } from 'chai';
1112
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
1213

@@ -73,6 +74,8 @@ describe('api:request:graphql NUT', () => {
7374
describe('std out', () => {
7475
it('get result in json format', () => {
7576
const result = execCmd('api request graphql --body standard.txt').shellOutput.stdout;
77+
// eslint-disable-next-line no-console
78+
console.log('res', util.inspect(result));
7679

7780
// make sure we got a JSON object back
7881
const parsed = JSON.parse(result) as Record<string, unknown>;
@@ -86,7 +89,8 @@ describe('api:request:graphql NUT', () => {
8689

8790
it('get no results correctly', () => {
8891
const result = execCmd('api request graphql --body noResults.txt').shellOutput.stdout;
89-
92+
// eslint-disable-next-line no-console
93+
console.log('res', util.inspect(result));
9094
// make sure we got a JSON object back
9195
const parsed = JSON.parse(result) as Record<string, unknown>;
9296
expect(Object.keys(parsed)).to.have.length;
@@ -100,7 +104,6 @@ describe('api:request:graphql NUT', () => {
100104
describe('stream-to-file', () => {
101105
it('get result in json format', () => {
102106
execCmd('api request graphql --body standard.txt --stream-to-file out.txt').shellOutput.stdout;
103-
104107
// make sure we got a JSON object back
105108
const parsed = JSON.parse(fs.readFileSync(join(testSession.project.dir, 'out.txt'), 'utf8')) as Record<
106109
string,

0 commit comments

Comments
 (0)