mirror of
https://github.com/google/pebble.git
synced 2025-05-22 03:14:52 +00:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
26
third_party/jerryscript/js_tooling/tests/.eslintrc.js
vendored
Normal file
26
third_party/jerryscript/js_tooling/tests/.eslintrc.js
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
]
|
||||
}
|
||||
};
|
1
third_party/jerryscript/js_tooling/tests/fixtures/multiple-emojis.js
vendored
Normal file
1
third_party/jerryscript/js_tooling/tests/fixtures/multiple-emojis.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
"😀😢";
|
1
third_party/jerryscript/js_tooling/tests/fixtures/syntax-error.js
vendored
Normal file
1
third_party/jerryscript/js_tooling/tests/fixtures/syntax-error.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
var x = "
|
19
third_party/jerryscript/js_tooling/tests/package.json
vendored
Normal file
19
third_party/jerryscript/js_tooling/tests/package.json
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "js_tooling-unittests",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "test_js_tooling.js",
|
||||
"devDependencies": {
|
||||
"eslint": "^2.10.2",
|
||||
"eslint-plugin-import": "^1.11.1",
|
||||
"eslint-plugin-jsx-a11y": "^2.0.1",
|
||||
"mocha": "^2.5.3",
|
||||
"unroll": "^1.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "NODE_PATH=.. ./node_modules/mocha/bin/mocha *.js",
|
||||
"lint": "./node_modules/eslint/bin/eslint.js -c .eslintrc.js *.js"
|
||||
},
|
||||
"author": "",
|
||||
"license": "© Pebble Technology Corp."
|
||||
}
|
24
third_party/jerryscript/js_tooling/tests/test_js_tooling.js
vendored
Normal file
24
third_party/jerryscript/js_tooling/tests/test_js_tooling.js
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* eslint-env mocha */
|
||||
/* eslint func-names: 0 */
|
||||
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
const unroll = require('unroll');
|
||||
unroll.use(it);
|
||||
|
||||
const fs = require('fs');
|
||||
const jsCompiler = require('../_js_tooling.js');
|
||||
|
||||
describe('js_tooling.js', () => {
|
||||
unroll('compiles #filename with #expectedResult', (done, fixture) => {
|
||||
var js_file = path.join('fixtures', fixture.filename);
|
||||
var js = fs.readFileSync(js_file, 'utf8');
|
||||
const result = jsCompiler.createSnapshot(js);
|
||||
assert.equal(result.result, fixture.expectedResult);
|
||||
done();
|
||||
}, [
|
||||
['filename', 'expectedResult'],
|
||||
['multiple-emojis.js', 'success'],
|
||||
['syntax-error.js', 'error']
|
||||
]);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue