code cleanup
This commit is contained in:
parent
06f0908443
commit
2ec68e0e69
|
@ -32,9 +32,9 @@
|
|||
"jest": "^25.1.0",
|
||||
"jest-each": "25.5.0",
|
||||
"jest-puppeteer": "^4.4.0",
|
||||
"node-stream-zip": "^1.13.6",
|
||||
"node-stream-zip": "^1.13.6",
|
||||
"request": "^2.88.2",
|
||||
"sprintf-js": "^1.1.2"
|
||||
"sprintf-js": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.12.8",
|
||||
|
|
|
@ -44,9 +44,9 @@ const resolvePackage = ( packageName, allowRecurse = true ) => {
|
|||
if ( ! resolvedPackage.path.length && allowRecurse ) {
|
||||
const packageLockPath = path.resolve( appPath, 'package-lock.json' );
|
||||
const packageLockContent = fs.readFileSync( packageLockPath );
|
||||
const packageLockData = JSON.parse( packageLockContent );
|
||||
const { dependencies } = JSON.parse( packageLockContent );
|
||||
|
||||
for ( const [ key, value ] of Object.entries( packageLockData.dependencies ) ) {
|
||||
for ( const [ key, value ] of Object.entries( dependencies ) ) {
|
||||
if ( value.version.indexOf( packageName ) == 0 ) {
|
||||
resolvedPackage = resolvePackage( key, false );
|
||||
break;
|
||||
|
@ -69,8 +69,8 @@ const resolvePackagePath = ( filename, packageName = '' ) => {
|
|||
if ( ! packageName.length ) {
|
||||
packagePath = path.resolve( __dirname, '../' );
|
||||
} else {
|
||||
const package = resolvePackage( packageName );
|
||||
packagePath = package.path;
|
||||
const pkg = resolvePackage( packageName );
|
||||
packagePath = pkg.path;
|
||||
}
|
||||
|
||||
const resolvedPath = path.resolve(
|
||||
|
|
|
@ -78,7 +78,7 @@ export const withRestApi = {
|
|||
};
|
||||
|
||||
const response = await client.put( onboardingProfileEndpoint, onboardingReset );
|
||||
expect( response.status ).toEqual( 200 );
|
||||
expect( response.statusCode ).toEqual( 200 );
|
||||
},
|
||||
/**
|
||||
* Use api package to delete coupons.
|
||||
|
|
Loading…
Reference in New Issue