UNPKG

@wider/utils_proto

Version:

A set of extensions to basic objects giving uniform behaviour in various technical environments

55 lines (46 loc) 1.73 kB
'use strict'; /** * A test utility that can be run from node directly to demonstrate selected string functions. * *[Source code](./proto_number_test.js.html) * * Run from this package's main directory * * ```cmd * node ./proto_number/test.js * ... test output ... * ``` * * or * * ```cmd * $ node * Welcome to Node.js * > import("./proto_number/test.js").then(() => {process.exit()}) * Promise { pending } * > ... test output ... * $ * ``` * * @module @wider/utils_proto/proto_number/test * * @copyright Copyright (C) 1985..2021 Martin Baker. http://y-d-r.co.uk * @author Martin W Baker * @license ISC Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import assignNumber from "./index.js"; const $moduleName = assignNumber.$moduleName + "/test"; const m_title = $moduleName + " demonstration"; console.log($moduleName + " starting test"); assignNumber(); console.log(m_title + ": starting test for "); // if using full $wider you will also need to provide a ydr-conf.json in this folder //const $wider = require("@wider/utils_proto/proto_number") //TODO // if you are only using select components then // const wider = { item1 : require("item1"), etc }; // create your test run here with or without express is appropriate console.log($moduleName + ": wider_two - two digit number from 4.455 >> " + (4.455).wider_two()); console.log($moduleName + ": wider_bitsUpTo - 240 >> " + (240).wider_bitsUpTo()); console.log($moduleName + ": test complete for " + m_title);