kumquat-buildroot/support/testing/tests/package/sample_nodejs_module.js
Thomas Petazzoni f25b0b6d1d support/testing/tests: add NodeJS tests
This commit adds two new test cases:

 - TestNodeJSBasic which builds a target configuration with just
   NodeJS enabled, and which runs a very simple NodeJS script on the
   target.

 - TestNodeJSModule, which builds a target configuration with NodeJS
   enabled + the installation of one extra module, which means npm on
   the host (from host-nodejs) is used, and which runs a very simple
   NodeJS script on the target that uses this extra module.

Having both tests separately allows to validate that both nodejs-only
and nodejs+host-nodejs configurations behave correctly, at least in
minimal scenarios.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-02-11 00:13:08 +01:00

8 lines
198 B
JavaScript

var assert = require('assert');
var lodash = require('lodash');
result = lodash.chunk(['a', 'b', 'c', 'd'], 2);
expected = [ [ 'a', 'b' ], [ 'c', 'd' ] ];
assert.deepStrictEqual(result, expected)