npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-tape

v1.0.0-4

Published

_Like airtap but with support for react-native/expo_

Downloads

14

Readme

rn-tape

Like airtap but with support for react-native/expo

Usage

rn-tape is a node-js command-line tool that you can download/install/access through npm.

You can use it quickly and directly using npx (comes with node)

$ npx rn-tape run android ./

In a project it is recommended to add it as a development dependency, this way it is clear which version of rn-tape works for testing your work.

$ npm install rn-tape --save-dev

For detailed usage information you can question the help:

$ npx rn-tape --help run

rn-tape run <system> [location] [test]

Run your package's tests in react-natives

Positionals:
  location  The path to the package you wish to test
                                                                 [default: "./"]
  test      A relative path within your package to its test entry point
                                                              [default: "/test"]
  system    The system you want to run the tests on
                                  [required] [choices: "android", "ios", "expo"]

Options:
  --version    Show version number                                     [boolean]
  --help       Show help                                               [boolean]
  --accessKey  Your bowserstack access key if you plan on using Browserstack
  --user       Your browserstack username if you plan on using Browserstack.
               Specifying this will eanble testing with Browserstack
  --device     The device you wish you run Browserstack tests on
  --osVersion  The OS Version for the device you wish to run Browserstack tests
               on

About

:wave: Hi! so we have been working on testing react-native libraries (specifically native ones) - actual - devices in a Continuous integration context. In other words: Automatically test every push to github if it works on all devices.

If you look at react-native libraries out there you might notice that most of them do not include CI tests (its rare to see any) but more importantly most of the non-react-native libraries (general npm libraries) are not tested for react-native. Which breaks quite a few and makes the setup process really stressful.

As a proof-of-concept we added the kind of tests to illustrate what we want to get working in get-random-values-poly-pony - The tests of that project run on Node.js, on browsers via browserstack and on react-native android/ios (also via browserstack), and on expo (also via browserstack).

This was hard work! And to make sure that this hard work doesn't need to be done by many other people, we want to make it easier for other people to get the same setup up-and-running.

Why is it a challenge? Existing javascript test solutions assume a immutable environment (without custom native code). But react-native allows to modify the javascript environment (native modules). In order to test react-native/expo modules on devices an actual app needs to be prepared and built to be installed on the device, which is not supported by any test framework we have seen.

Now we are looking for people that help us, make this more general for everyone, something like airtap with additional support for react-native.

We are looking for people to:

  • check the code
  • write documentation / logo / add it to books
  • use it in their library
  • send pull requests to existing react-native libraries (like native-udp or native-tcp)

We will be working on this repository in the next weeks: Ask questions using issues

Note: As far as unit-test frameworks are concerned: many node/javascript libraries use tape (particularly in the dat community). But tape does not work out-of-the-box with react-native, which is why Martin is maintaining a slightly fixed fork of tape that works with react-native: fresh-tape.

How it Works

  • This repo contains a React-Native project which runs your test code
  • The CLI will compile your code with babel and put it in a temporary folder
  • Your code will be set up as a dependency of this project.
  • The project is then compiled with react-native to generate an IPA or APK
  • Before compiling, the CLI will start an HTTP server which will be connected to via NGROK
  • Logs from the app will be sent to the HTTP server, and will be displayed in the CLI
  • It will then either run the app in browserstack or locally
  • For browserstack support, you'll need to add the BROWSERSTACK_USER and BROWSERSTACK_ACCESS_KEY environment variables, or use the --user and --accessKey CLI options.
  • Once the app has finished sending all the data over, everything will be closed.