Skip to content
Myr

Try to add old Node.js to CI

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Sitnik · committed by Andrey Sitnik · parent 468813e · Browse files · 2 files+49 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+49 added−0 removed

  • tests:+42 added−0 removed
  • other:+7 added−0 removed

2 files+49 added−0 removed

added:test/ci+42 added
1#!/usr/bin/env node2/* eslint-disable global-require, no-inner-declarations */34if (parseInt(process.versions.node) >= 6 && false) {5 var spawn = require('child_process').spawn67 spawn('npm', ['test'], { stdio: 'inherit' }).on('exit', function (code) {8 if (code > 0) process.exit(code)9 })10} else {11 var assert = require('assert')12 var nonSecure = require('../non-secure')13 var nanoid = require('../')14 var async = require('../async')15 var url = require('../url')1617 var used = { }18 function test (id) {19 assert.ok(typeof id === 'string')20 assert.ok(id.length === 21)21 for (var j = 0; j < id.length; j++) {22 assert.ok(url.indexOf(id[j]) !== -1)23 }24 assert.ok(!used[id])25 used[id] = true26 }2728 for (var i = 0; i < 1000; i++) {29 test(nanoid())30 test(nonSecure())31 async(21, function (err, id) {32 assert.ok(err === null)33 test(id)34 })35 }36 assert.ok(nanoid(10).length === 10)37 assert.ok(nonSecure(10).length === 10)38 async(10, function (err, id) {39 assert.ok(err === null)40 assert.ok(id.length === 10)41 })42}
modified:.travis.yml+7 added