benoitzugmeyer / babel-plugin-test-export Goto Github PK
View Code? Open in Web Editor NEWExport private variables and functions to your tests
License: ISC License
Export private variables and functions to your tests
License: ISC License
This code doesn't expose the marked as exposed function
'use strict'
// Using false will remove the entry from the object and will ease the roles retrieval
const Overrides = {
zob : true,
}
/**
* Filter rights according to their Boolean value
* @param {Object} rights An object with rights to filter on
* @return {Set} The list of rights available to this user
*/
// @test-export
function format(rights) {
console.log('whatever')
}
module.exports = {}
But this one does
'use strict'
// Using false will remove the entry from the object and will ease the roles retrieval
const Overrides = {
zob : true,
}
/**
* Filter rights according to their Boolean value
* @param {Object} rights An object with rights to filter on
* @return {Set} The list of rights available to this user
*/
// @test-export
function format(rights) {
console.log('whatever')
}
module.exports = {}
The diff between the two is the following:
diff --git a/toto.js b/Volumes/Work/euronews/api/src/utils/rights.js
index a7907b3..9901739 100644
--- a/toto.js
+++ b/Volumes/Work/euronews/api/src/utils/rights.js
@@ -2,7 +2,7 @@
// Using false will remove the entry from the object and will ease the roles retrieval
const Overrides = {
-// zob : true,
+ zob : true,
}
/**
@@ -16,4 +16,3 @@ function format(rights) {
}
module.exports = {}
I tried looking at the src but I must admit I'm no good at reCAST ๐
I made a small repo as an example that you can find here
I may be using this wrong :3
They are not supported as-is, but maybe it can be supported if babel-plugin-transform-es2015-modules-commonjs
is run before babel-plugin-test-export
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.