-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c359f2e
commit 3fbc3ff
Showing
11 changed files
with
117 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const {ok} = require('assert'); | ||
const {runSync} = require('../helpers'); | ||
const assert = require('assert'); | ||
|
||
describe('dataize', function() { | ||
const home = path.resolve('temp/test-dataize') | ||
const target = path.resolve(home, 'target') | ||
const project = path.resolve(target, 'project') | ||
const runtime = path.resolve('../eo2js-runtime') | ||
beforeEach('clear home', function() { | ||
fs.rmSync(home, {recursive: true, force: true}) | ||
fs.mkdirSync(project, {recursive: true}) | ||
}) | ||
it('should execute node run', function() { | ||
ok(true) // todo | ||
it('should dataize app object', function() { | ||
runSync(['link', '-t', target, '-p project', '--alone', '-d', runtime]) | ||
fs.copyFileSync( | ||
path.resolve('test/resources/dataize/app.js'), | ||
path.resolve(project, 'app.js') | ||
) | ||
const log = runSync([ | ||
'dataize', 'app', '--alone', '-t', target, '-p project', '-d', runtime | ||
]) | ||
assert.ok(log.includes('= "Hello, world!"')) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Object for testing dataization. | ||
* @return {Object} object - Test object | ||
*/ | ||
const app = function() { | ||
const object = require('eo2js-runtime/src/runtime/object') | ||
const {PHI, DELTA} = require('eo2js-runtime/src/runtime/attribute/specials') | ||
const attr = require('eo2js-runtime/src/runtime/attribute/attr') | ||
const bytesOf = require('eo2js-runtime/src/runtime/bytes-of') | ||
const obj = object('app') | ||
obj.attrs[PHI] = attr.lambda( | ||
obj, (_) => { | ||
const inner = object('app$phi') | ||
inner.assets[DELTA] = bytesOf('Hello, world!').asBytes() | ||
return inner | ||
} | ||
) | ||
return obj | ||
} | ||
|
||
module.exports = app |