Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Added TEST_BABEL_BUILD option to 'npm test' command

Jan Curn5a98fe6684ad
diff --git a/package.json b/package.json
index d6de074b3..9fb849de6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "apifier",
- "version": "0.0.8",
+ "version": "0.0.10",
"description": "Apifier SDK for JavaScript",
"main": "build/index.js",
"keywords": [
@@ -24,12 +24,12 @@
"bugs": {
"url": "https://github.com/apifier/apifier-sdk-js/issues"
},
- "homepage": "https://github.com/apifier/apifier-sdk-js#readme",
+ "homepage": "https://github.com/apifier/apifier-sdk-js",
"scripts": {
"test": "mocha --compilers js:babel-core/register --recursive",
"test-cov": "babel-node isparta cover --report html --report text node_modules/.bin/_mocha",
"build": "babel src --out-dir build",
- "prepublishOnly": "npm run build && npm test",
+ "prepublishOnly": "npm run build && TEST_BABEL_BUILD=1 npm test",
"clean": "rm -rf build",
"lint": "eslint src test"
},
diff --git a/test/actor.js b/test/actor.js
index ae363ca82..eec22f815 100644
--- a/test/actor.js
+++ b/test/actor.js
@@ -1,7 +1,9 @@
import { expect } from 'chai';
// NOTE: use require() here because this how its done in acts
-const Apifier = require('../src/index');
+const Apifier = process.env.TEST_BABEL_BUILD ? require('../build/index') : require('../src/index');
+
+if (process.env.TEST_BABEL_BUILD) console.log('Running with TEST_BABEL_BUILD option');
/* global process */