Skip to content

Commit

Permalink
https://github.com/dsheiko/puppetry/issues/93
Browse files Browse the repository at this point in the history
  • Loading branch information
dsheiko committed Aug 13, 2021
1 parent 45cc996 commit e02abb9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ module.exports = {
"identifiers": false,
"lang": "en_US",
"skipWords": [
"hfirefox",
"Puppetter",
"reCaptcha",
"Captcha",
Expand Down
5 changes: 3 additions & 2 deletions src/component/Modal/TestReportModal/BrowserOptions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Checkbox, Select, Icon } from "antd";
import { Checkbox, Select } from "antd";
import ErrorBoundary from "component/ErrorBoundary";
import AbstractComponent from "component/AbstractComponent";
import BrowseDirectory from "component/Global/BrowseDirectory";
Expand Down Expand Up @@ -209,7 +209,8 @@ export class BrowserOptions extends AbstractComponent {
{ [ "headless", "chromium", "chrome" ].includes( this.state.product ) ?
<ChromeArguments ref={ this.refChromeArguments } /> : null }

{ [ "_firefox", "firefox" ].includes( this.state.product ) ? <FirefoxArguments ref={ this.refFirefoxArguments } /> : null }
{ [ "_firefox", "firefox" ].includes( this.state.product )
? <FirefoxArguments ref={ this.refFirefoxArguments } /> : null }

{ [ "headless", "chromium", "chrome" ].includes( this.state.product ) ?
<div className="browser-options-layout">
Expand Down
5 changes: 4 additions & 1 deletion src/component/Schema/Jest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ const {
bs, util, fetch, localStorage
} = require( "../lib/bootstrap" )( ${ JSON.stringify( normalizeName( title ) ) } ),
puppeteerOptions = require( "../puppeteer.config.json" ),
devices = require( "puppeteer" ).devices;
devices = require( "puppeteer" ).devices,
fs = require( "fs" ),
path = require( "path" ),
os = require( "os" );
${ runner === RUNNER_PUPPETRY ? `
Expand Down
3 changes: 1 addition & 2 deletions src/component/Schema/Params/Element/upload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FILE, INPUT, INPUT_NUMBER } from "../../constants";
import { renderTarget, result } from "service/utils";
import ExpressionParser from "service/ExpressionParser";
import fs from "fs";
import { join } from "path";

export const upload = {
Expand Down Expand Up @@ -103,4 +102,4 @@ export const upload = {
}
}
]
};
};
3 changes: 3 additions & 0 deletions src/service/ExpressionParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class Parsers {

// {{ FOO }}
variable = ( key ) => `ENV[ "${ key }" ]`;

// {{ eval("process.cwd()") }}
eval = ([ key ]) => key;
}

export default class ExpressionParser {
Expand Down
5 changes: 3 additions & 2 deletions src/service/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ export function justify( text ) {
}

function parseTpl( value, id, type ) {
if ( typeof type === "undefined" || type !== "string" ) {
// https://github.com/dsheiko/puppetry/pull/91/commits/8c939d2bd822a88eb49511e78ac5055d17828962
if ( typeof type === "undefined" || !( type == "string" || type == "text" ) ) {
return JSON.stringify( value );
}
// @see ./src/component/Schema/Params/Element/assertText.js
// @see ./src/component/Schema/Params/Element/assertText.js
if ( typeof type !== "undefined" && type === "text" ) {
value = value.replace( /\n+/gm, "\n" );
}
Expand Down
2 changes: 1 addition & 1 deletion src/service/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export function initRuntimeTestPath() {
return;
}
try {
shell.mkdir( "-p" , DEST_DIR );
shell.mkdir( "-p" , DEST_DIR );
shell.cp( "-f" , SRC_DIR + "/package.json", DEST_DIR + "/" );
shell.chmod( "-R", 777, DEST_DIR );
} catch ( e ) {
Expand Down

0 comments on commit e02abb9

Please sign in to comment.