Skip to content

Commit

Permalink
Helpers to generate the blueprint URL for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Feb 14, 2025
1 parent 85e5816 commit ea0abb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env node,es6 */

const fs = require( 'fs' );
const ignoreParse = require( 'parse-gitignore' );

module.exports = function( grunt ) {
Expand Down Expand Up @@ -45,4 +46,12 @@ module.exports = function( grunt ) {
'copy',
]
);

grunt.registerTask(
'blueprint-url',
function() {
const blueprintJson = JSON.parse( fs.readFileSync( 'assets/blueprints/blueprint.json', 'utf8' ) );
grunt.log.write( `Blueprint URL: https://playground.wordpress.net/#${ encodeURI( JSON.stringify( blueprintJson ) ) }` );
}
);
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"test": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor vendor/bin/phpunit --",
"test:watch": "npm run composer test:watch",
"composer": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor composer --",
"preinstall": "composer install"
"preinstall": "composer install",
"blueprint": "grunt blueprint-url"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit ea0abb6

Please sign in to comment.