ast-workshop
ast-workshop copied to clipboard
Solution to 05b-strip-test-selectors
Hey @Turbo87, thanks for putting together the workshop in written form. Loving it! Do you have the solution for 05b-strip-test-selectors
?
I have the following code in ember-cli-build.js
, but I still see data-test-***
attributes in the DOM when I npm start
, which I restarted.
class StripTestSelectorsTransform {
transform(root) {
this.syntax.traverse(root, {
// TODO write your implementation here
AttrNode(node) {
if (node.name.startsWith('data-test-')) {
return null;
}
}
});
return root;
}
}