UNPKG

inventora-shopify-admin-api

Version:

Shopify Admin API is a NodeJS library built to help developers easily authenticate and make calls against the Shopify API. It was inspired by and borrows heavily from ShopifySharp.

25 lines (18 loc) 781 B
import * as fs from 'fs'; import * as path from 'path'; type Package = { scripts: { [name: string]: string } }; const pkg: Package = require("../package.json"); const testFiles = fs.readdirSync(path.join(__dirname, "../tests")); testFiles.forEach(fileName => { const fileInfo = path.parse(fileName); if (fileInfo.name === "_utils") { return; } const scriptName = `test:${fileInfo.name}`; const rawScriptName = `${scriptName}:raw`; const rawScriptValue = `alsatian -T ./dist/tests/${fileInfo.name}.js`; const scriptValue = `${rawScriptValue} | tap-spec`; pkg.scripts[scriptName] = scriptValue; pkg.scripts[rawScriptName] = rawScriptValue; }) fs.writeFileSync(path.join(__dirname, "../package.json"), JSON.stringify(pkg, null, 4));