normalize-walker
Advanced tools
Comparing version 0.1.5 to 0.2.0
{ | ||
"name": "normalize-walker", | ||
"description": "Walk down dependencies of JS, CSS, HTML, etc. and create a tree. ", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
@@ -14,4 +14,2 @@ | ||
options = options || {} | ||
walker.use(Walker.plugins.text(options)) | ||
walker.use(Walker.plugins.json(options)) | ||
walker.use(Walker.plugins.js(options)) | ||
@@ -18,0 +16,0 @@ walker.use(Walker.plugins.css(options)) |
@@ -14,4 +14,2 @@ | ||
options = options || {} | ||
walker.use(Walker.plugins.text(options)) | ||
walker.use(Walker.plugins.json(options)) | ||
walker.use(Walker.plugins.js(options)) | ||
@@ -49,56 +47,2 @@ walker.use(Walker.plugins.css(options)) | ||
describe('js-html', function () { | ||
var entrypoint = fixture('js-html') | ||
var walker | ||
var tree | ||
var file | ||
it('should walk', co(function* () { | ||
walker = defaults(Walker().add(entrypoint)) | ||
tree = yield* walker.tree() | ||
})) | ||
it('should return the correct tree', co(function* () { | ||
tree = tree[entrypoint] | ||
assert(tree) | ||
assert.equal(tree.uri, entrypoint) | ||
file = tree.file.dependencies['./thing.html.js'].file | ||
})) | ||
it('should transform the string', co(function* () { | ||
var string = yield* file.getString() | ||
string = string.replace(/export default\s*/, '') | ||
string = JSON.parse(string) | ||
assert.deepEqual(string.trim(), '<body></body>') | ||
})) | ||
}) | ||
describe('js-json', function () { | ||
var entrypoint = fixture('js-json') | ||
var walker | ||
var tree | ||
var file | ||
it('should walk', co(function* () { | ||
walker = defaults(Walker().add(entrypoint)) | ||
tree = yield* walker.tree() | ||
})) | ||
it('should return the correct tree', co(function* () { | ||
tree = tree[entrypoint] | ||
assert(tree) | ||
assert.equal(tree.uri, entrypoint) | ||
file = tree.file.dependencies['./stuff.json.js'].file | ||
})) | ||
it('should transform the string', co(function* () { | ||
var string = yield* file.getString() | ||
string = string.replace(/export default\s*/, '') | ||
string = JSON.parse(string) | ||
assert.deepEqual(string, { | ||
message: 'LOL' | ||
}) | ||
})) | ||
}) | ||
describe('js-circular', function () { | ||
@@ -105,0 +49,0 @@ var entrypoint = fixture('js-circular') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23554
33
697