7
7
8
8
import { join } from 'node:path' ;
9
9
import { readFileSync } from 'node:fs' ;
10
+ import * as os from 'node:os' ;
10
11
import { config , expect } from 'chai' ;
11
12
import { execCmd , TestSession } from '@salesforce/cli-plugins-testkit' ;
12
13
13
14
config . truncateThreshold = 0 ;
14
15
15
- describe ( 'api:request:rest NUT' , ( ) => {
16
+ const skipIfWindows = os . arch ( ) === 'Win32' ? describe . skip : describe ;
17
+
18
+ // windows NUTs have been failing with
19
+ // URL No Longer Exists</span></td></tr>
20
+ // <tr><td>You have attempted to reach a URL that no longer exists on salesforce.com. <br/><br/>
21
+ // You may have reached this page after clicking on a direct link into the application. This direct link might be: <br/>
22
+ // A bookmark to a particular page, such as a report or view <br/>
23
+ // A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link <br/>
24
+ // A link to a particular page in your email templates <br/><br/>
25
+ //
26
+ // seems to be related to clickjack protection - https://help.salesforce.com/s/articleView?id=000387058&type=1
27
+ // I've confirmed the 'api request rest' command passes on windows
28
+
29
+ skipIfWindows ( 'api:request:rest NUT' , ( ) => {
16
30
let testSession : TestSession ;
17
31
18
32
before ( async ( ) => {
19
- // eslint-disable-next-line no-console
20
- console . log ( 'start before' ) ;
21
33
testSession = await TestSession . create ( {
22
34
scratchOrgs : [
23
35
{
@@ -36,11 +48,8 @@ describe('api:request:rest NUT', () => {
36
48
37
49
describe ( 'std out' , ( ) => {
38
50
it ( 'get result in json format' , ( ) => {
39
- // eslint-disable-next-line no-console
40
- console . log ( 'start test' ) ;
41
51
const result = execCmd ( "api request rest 'services/data/v60.0/limits'" ) . shellOutput . stdout ;
42
- // eslint-disable-next-line no-console
43
- console . log ( 'res1' , result ) ;
52
+
44
53
// make sure we got a JSON object back
45
54
expect ( Object . keys ( JSON . parse ( result ) as Record < string , unknown > ) ) . to . have . length ;
46
55
} ) ;
0 commit comments