mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-27 04:20:38 -09:00
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>
This commit is contained in:
committed by
Yann E. MORIN
parent
0de216f95f
commit
f25b0b6d1d
7
support/testing/tests/package/sample_nodejs_module.js
Normal file
7
support/testing/tests/package/sample_nodejs_module.js
Normal file
@@ -0,0 +1,7 @@
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user