quackage 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "Hash": "testPictQUACKAGEPROJECTNAMECAPQUACKAGESCOPEtestjs",
9
9
  "Path": "test/Pict_QUACKAGEPROJECTNAMECAP_QUACKAGESCOPE_test.js",
10
- "Content": "/*\n\tUnit tests for LIBRARYNAMEHERE Basic\n*/\n\nconst _Package = require(`../package.json`);\n\n// This is temporary, but enables unit tests\nconst libBrowserEnv = require('browser-env')\nlibBrowserEnv();\n\nconst Chai = require('chai');\nconst Expect = Chai.expect;\n\nconst libPict = require('pict');\n\nconst configureTestPict = (pPict) =>\n{\n\tlet tmpPict = (typeof(pPict) == 'undefined') ? new libPict() : pPict;\n\ttmpPict.TestData = (\n\t\t{\n\t\t\tReads: [],\n\t\t\tAssignments: [],\n\t\t\tAppends: [],\n\t\t\tGets: []\n\t\t});\n\ttmpPict.ContentAssignment.customReadFunction = (pAddress, pContentType) =>\n\t{\n\t\ttmpPict.TestData.Reads.push(pAddress);\n\t\ttmpPict.log.info(`Mocking a read of type ${pContentType} from Address: ${pAddress}`);\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customGetElementFunction = (pAddress) =>\n\t{\n\t\ttmpPict.TestData.Gets.push(pAddress);\n\t\ttmpPict.log.info(`Mocking a get of Address: ${pAddress}`);\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customAppendElementFunction = (pAddress, pContent) =>\n\t{\n\t\ttmpPict.TestData.Appends.push(pAddress);\n\t\ttmpPict.log.info(`Mocking an append of Address: ${pAddress}`, {Content: pContent});\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customAssignFunction = (pAddress, pContent) =>\n\t{\n\t\ttmpPict.TestData.Assignments.push(pAddress);\n\t\ttmpPict.log.info(`Mocking an assignment of Address: ${pAddress}`, {Content: pContent});\n\t\treturn '';\n\t}\n\n\treturn tmpPict;\n}\n\nconst libPictExtension = require(`../${_Package.main}`);\n\nsuite\n(\n\t`Basic ${_Package.name}.v.${_Package.version} tests`,\n\t() =>\n\t{\n\t\tsetup(() => { });\n\n\t\tsuite\n\t\t\t(\n\t\t\t\t'Basic Basic Tests',\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\ttest(\n\t\t\t\t\t\t\t'Constructor properly crafts an object',\n\t\t\t\t\t\t\t(fDone) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet _Pict = configureTestPict();\n\t\t\t\t\t\t\t\tlet _PictExtension = _Pict.addView({}, 'Pict-Test-{~RandomNumberString:4,9000~}', libPictExtension);\n\t\t\t\t\t\t\t\tExpect(_PictExtension).to.be.an('object');\n\t\t\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t}\n);"
10
+ "Content": "/*\n\tUnit tests for {~Data:Record.Scope~} in {~Data:Record.Quackage.AppData.Package.name~} from Quackage Boilerplate\n*/\n\n// This is used to grab the source file from the package.json\nconst _Package = require(`../package.json`);\n// Get the \"main\" view from the package.json\n// If you want to test a specific subview, you can delete the above line and change the require below to the specific file.\nconst libPictView = require(`../${_Package.main}`);\n\n// Mocha, chai and the Expect verb\nconst Chai = require(\"chai\");\nconst Expect = Chai.expect;\n\n// This extends node to have the browser environment globals like window and document.\nconst libBrowserEnv = require('browser-env')\nlibBrowserEnv();\n\nconst libPict = require('pict');\n\nconst _MockPictConfiguration = (\n{\n\tProduct: 'MockPict-ViewTest',\n\tProductVersion: _Package.version\n});\n\n// Any view-specific configuration goes here.\n// If there is no default_configuration object exported with your view, use an empty JSON object\nconst _MockPictViewConfiguration = (typeof(libPictView.default_configuration) === 'undefined') ? {} : libPictView.default_configuration;\n\nsuite\n(\n\t'{~Data:Record.Quackage.AppData.Package.name~} Pict View Suite',\n\tfunction()\n\t{\n\t\tsetup\n\t\t(\n\t\t\tfunction()\n\t\t\t{\n\t\t\t}\n\t\t);\n\n\t\tsuite\n\t\t(\n\t\t\t'Low Level',\n\t\t\tfunction()\n\t\t\t{\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Construction',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initialize();\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization (async)',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initializeAsync(\n\t\t\t\t\t\t\t(fCallback) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n);"
11
11
  }
12
12
  ]
13
13
  },
@@ -34,12 +34,12 @@
34
34
  {
35
35
  "Hash": "sourcePictViewQUACKAGEPROJECTNAMECAPjs",
36
36
  "Path": "source/Pict-View-QUACKAGEPROJECTNAMECAP.js",
37
- "Content": "const libPictView = require('pict-view');\n\nclass PictSection{~PascalCaseIdentifier:AppData.Package.name~} extends libPictView\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tsuper(pFable, pOptions, pServiceHash);\n\n\t\tthis.log.info(`PictSection{~PascalCaseIdentifier:AppData.Package.name~}::constructor() executing...`);\n\t}\n}\n\nmodule.exports = PictSection{~PascalCaseIdentifier:AppData.Package.name~};"
37
+ "Content": "const libPictView = require('pict-view');\n\nclass {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} extends libPictView\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tsuper(pFable, pOptions, pServiceHash);\n\t}\n\n\t// The only thing that should be put in this constructor is internal state initialization (non AppData state)\n}\n\nmodule.exports = {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~};\n\nmodule.exports.default_configuration =\n{\n\tViewIdentifier: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}',\n\tDefaultRenderable: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',\n\tDefaultDestinationAddress: '#BridgeInspectionNavigationContainer',\n\tTemplates:\n\t[\n\t\t{\n\t\t\tHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',\n\t\t\tTemplate: /*html*/`\n<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} pict view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->\n<!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} end view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->\n`,\n\t\t},\n\t],\n\tRenderables:\n\t[\n\t\t{\n\t\t\tRenderableHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',\n\t\t\tTemplateHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',\n\t\t\tDestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',\n\t\t\tRenderMethod: 'replace'\n\t\t},\n\t]\n};\n"
38
38
  },
39
39
  {
40
- "Hash": "testPictViewQUACKAGEPROJECTNAMECAPjs",
41
- "Path": "test/Pict-View-QUACKAGEPROJECTNAMECAP.js",
42
- "Content": "/*\n\tUnit tests for Pict View: {~PascalCaseIdentifier:AppData.Package.name~}\n*/\n\n// This is temporary, but enables unit tests\nconst libBrowserEnv = require('browser-env')\nlibBrowserEnv();\n\nconst Chai = require('chai');\nconst Expect = Chai.expect;\n\nconst libPict = require('pict');\n\nconst configureTestPict = (pPict) =>\n{\n\tlet tmpPict = (typeof(pPict) == 'undefined') ? new libPict() : pPict;\n\ttmpPict.TestData = (\n\t\t{\n\t\t\tReads: [],\n\t\t\tAssignments: [],\n\t\t\tAppends: [],\n\t\t\tGets: []\n\t\t});\n\ttmpPict.ContentAssignment.customReadFunction = (pAddress, pContentType) =>\n\t{\n\t\ttmpPict.TestData.Reads.push(pAddress);\n\t\ttmpPict.log.info(`Mocking a read of type ${pContentType} from Address: ${pAddress}`);\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customGetElementFunction = (pAddress) =>\n\t{\n\t\ttmpPict.TestData.Gets.push(pAddress);\n\t\ttmpPict.log.info(`Mocking a get of Address: ${pAddress}`);\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customAppendElementFunction = (pAddress, pContent) =>\n\t{\n\t\ttmpPict.TestData.Appends.push(pAddress);\n\t\ttmpPict.log.info(`Mocking an append of Address: ${pAddress}`, {Content: pContent});\n\t\treturn '';\n\t}\n\ttmpPict.ContentAssignment.customAssignFunction = (pAddress, pContent) =>\n\t{\n\t\ttmpPict.TestData.Assignments.push(pAddress);\n\t\ttmpPict.log.info(`Mocking an assignment of Address: ${pAddress}`, {Content: pContent});\n\t\treturn '';\n\t}\n\n\treturn tmpPict;\n}\n\nconst lib{~PascalCaseIdentifier:AppData.Package.name~} = require(`../{~Data:AppData.Package.main~}`);\n\nsuite\n(\n\t'Pict View: {~PascalCaseIdentifier:AppData.Package.name~}',\n\t() =>\n\t{\n\t\tsetup(() => { });\n\n\t\tsuite\n\t\t\t(\n\t\t\t\t'Basic Tests',\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\ttest(\n\t\t\t\t\t\t\t'Object Initialization',\n\t\t\t\t\t\t\t(fDone) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlet _Pict = configureTestPict();\n\t\t\t\t\t\t\t\tlet _PictView{~PascalCaseIdentifier:AppData.Package.name~} = _Pict.addView({}, 'Pict-View-{~PascalCaseIdentifier:AppData.Package.name~}', lib{~PascalCaseIdentifier:AppData.Package.name~});\n\t\t\t\t\t\t\t\tExpect(_PictView{~PascalCaseIdentifier:AppData.Package.name~}).to.be.an('object');\n\t\t\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t}\n);"
40
+ "Hash": "testPictViewQUACKAGEPROJECTNAMECAPtestsjs",
41
+ "Path": "test/Pict-View-QUACKAGEPROJECTNAMECAP_tests.js",
42
+ "Content": "/*\n\tUnit tests for {~Data:Record.Scope~} in {~Data:Record.Quackage.AppData.Package.name~} from Quackage Boilerplate\n*/\n\n// This is used to grab the source file from the package.json\nconst _Package = require(`../package.json`);\n// Get the \"main\" view from the package.json\n// If you want to test a specific subview, you can delete the above line and change the require below to the specific file.\nconst libPictView = require(`../${_Package.main}`);\n\n// Mocha, chai and the Expect verb\nconst Chai = require(\"chai\");\nconst Expect = Chai.expect;\n\n// This extends node to have the browser environment globals like window and document.\nconst libBrowserEnv = require('browser-env')\nlibBrowserEnv();\n\nconst libPict = require('pict');\n\nconst _MockPictConfiguration = (\n{\n\tProduct: 'MockPict-ViewTest',\n\tProductVersion: _Package.version\n});\n\n// Any view-specific configuration goes here.\n// If there is no default_configuration object exported with your view, use an empty JSON object\nconst _MockPictViewConfiguration = (typeof(libPictView.default_configuration) === 'undefined') ? {} : libPictView.default_configuration;\n\nsuite\n(\n\t'{~Data:Record.Quackage.AppData.Package.name~} Pict View Suite',\n\tfunction()\n\t{\n\t\tsetup\n\t\t(\n\t\t\tfunction()\n\t\t\t{\n\t\t\t}\n\t\t);\n\n\t\tsuite\n\t\t(\n\t\t\t'Low Level',\n\t\t\tfunction()\n\t\t\t{\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Construction',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initialize();\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization (async)',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initializeAsync(\n\t\t\t\t\t\t\t(fCallback) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n);"
43
43
  }
44
44
  ]
45
45
  },
@@ -120,5 +120,17 @@
120
120
  "Content": "# Test Environment\ndebug/testenv\n\n# Quackage takes care of these for me!\n.babelrc\n.browserslistrc\n.browserslistrc-BACKUP\n.gulpfile-quackage.js\n.gulpfile-quackage-config.json\n\n# I just dislike this one.\n.DS_Store\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# Docusaurus cache and generated files\n.docusaurus\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*\n"
121
121
  }
122
122
  ]
123
+ },
124
+ "pictviewunittest": {
125
+ "Hash": "pictviewunittest",
126
+ "Name": "Pictviewunittest",
127
+ "Description": "A template set for pictviewunittest ...",
128
+ "Files": [
129
+ {
130
+ "Hash": "testPictQUACKAGEPROJECTNAMECAPQUACKAGESCOPEtestjs",
131
+ "Path": "test/Pict_QUACKAGEPROJECTNAMECAP_QUACKAGESCOPE_test.js",
132
+ "Content": "/*\n\tUnit tests for {~Data:Record.Scope~} in {~Data:Record.Quackage.AppData.Package.name~} from Quackage Boilerplate\n*/\n\n// This is used to grab the source file from the package.json\nconst _Package = require(`../package.json`);\n// Get the \"main\" view from the package.json\n// If you want to test a specific subview, you can delete the above line and change the require below to the specific file.\nconst libPictView = require(`../${_Package.main}`);\n\n// Mocha, chai and the Expect verb\nconst Chai = require(\"chai\");\nconst Expect = Chai.expect;\n\n// This extends node to have the browser environment globals like window and document.\nconst libBrowserEnv = require('browser-env')\nlibBrowserEnv();\n\nconst libPict = require('pict');\n\nconst _MockPictConfiguration = (\n{\n\tProduct: 'MockPict-ViewTest',\n\tProductVersion: _Package.version\n});\n\n// Any view-specific configuration goes here.\n// If there is no default_configuration object exported with your view, use an empty JSON object\nconst _MockPictViewConfiguration = (typeof(libPictView.default_configuration) === 'undefined') ? {} : libPictView.default_configuration;\n\nsuite\n(\n\t'{~Data:Record.Quackage.AppData.Package.name~} Pict View Suite',\n\tfunction()\n\t{\n\t\tsetup\n\t\t(\n\t\t\tfunction()\n\t\t\t{\n\t\t\t}\n\t\t);\n\n\t\tsuite\n\t\t(\n\t\t\t'Low Level',\n\t\t\tfunction()\n\t\t\t{\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Construction',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initialize();\n\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\ttest\n\t\t\t\t(\n\t\t\t\t\t'View Initialization (async)',\n\t\t\t\t\tfunction(fDone)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar testPict = new libPict(_MockPictConfiguration);\n\t\t\t\t\t\tlet testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);\n\t\t\t\t\t\ttestView.initializeAsync(\n\t\t\t\t\t\t\t(fCallback) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tExpect(testView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testPict.views.TestView).to.be.an('object');\n\t\t\t\t\t\t\t\tExpect(testView.UUID).to.equal(testPict.views.TestView.UUID);\n\t\t\t\t\t\t\t\treturn fDone();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n);"
133
+ }
134
+ ]
123
135
  }
124
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quackage",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Building. Testing. Quacking.",
5
5
  "main": "source/Quackage.js",
6
6
  "scripts": {
@@ -51,10 +51,12 @@
51
51
  "test": "npx mocha -u tdd -R spec",
52
52
  "tests": "npx mocha -u tdd --exit -R spec --grep",
53
53
 
54
- "coverage": "npx nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec",
55
-
56
- "build": "npx quack build",
54
+ "coverage": "npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",
57
55
 
56
+ "build": "npx quack build"
57
+ },
58
+ "LuxuryPackageScripts":
59
+ {
58
60
  "docker-dev-build": "docker build ./ -f Dockerfile_LUXURYCode -t {~Data:AppData.Package.name~}-image:local",
59
61
  "docker-dev-run": "docker run -it -d --name {~Data:AppData.Package.name~}-dev -p {~RandomNumber:10000,50000~}:8080 -p {~RandomNumber:10000,50000~}:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/{~Data:AppData.Package.name~}\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" {~Data:AppData.Package.name~}-image:local",
60
62
  "docker-dev-shell": "docker exec -it {~Data:AppData.Package.name~}-dev /bin/bash"
@@ -18,6 +18,7 @@ let _Pict = new libCLIProgram(
18
18
  [
19
19
  // Management for package.json
20
20
  require('./commands/Quackage-Command-UpdatePackage.js'),
21
+ require('./commands/Quackage-Command-UpdatePackage-Luxury.js'),
21
22
  require('./commands/Quackage-Command-Lint.js'),
22
23
 
23
24
  // Mocha test execution
@@ -36,6 +36,7 @@ class QuackageCommandBoilerplate extends libCommandLineCommand
36
36
  {
37
37
  let tmpTemplateFileSet = this.ArgumentString;
38
38
  let tmpScope = this.CommandOptions.scope;
39
+
39
40
  // Execute the command
40
41
  this.log.info(`Creating boilerplate file(s) for [${tmpTemplateFileSet}] Scoped as ${tmpScope}...`);
41
42
 
@@ -105,6 +106,7 @@ class QuackageCommandBoilerplate extends libCommandLineCommand
105
106
  tmpBoilerPlateRecord.Scope = tmpScope;
106
107
  tmpBoilerPlateRecord.Content = (typeof(this.CommandOptions.content) == 'string') ? this.CommandOptions.content : '';
107
108
  tmpBoilerPlateRecord.CommandOptions = this.CommandOptions;
109
+ tmpBoilerPlateRecord.Quackage = this;
108
110
 
109
111
  // Load each template in the fileset into the template provider
110
112
  for (let i = 0; i < tmpBoilerPlateRecord.Files.length; i++)
@@ -0,0 +1,102 @@
1
+ const libCommandLineCommand = require('pict-service-commandlineutility').ServiceCommandLineCommand;
2
+ const libFS = require('fs');
3
+
4
+ class QuackageCommandUpdatePackage extends libCommandLineCommand
5
+ {
6
+ constructor(pFable, pManifest, pServiceHash)
7
+ {
8
+ super(pFable, pManifest, pServiceHash);
9
+
10
+ this.options.CommandKeyword = 'luxuryupdatepackage';
11
+ this.options.Description = 'Update your package.json to build and run luxury code containers';
12
+
13
+ this.fable.TemplateProvider.addTemplate('PrototypePackage', JSON.stringify(this.pict.ProgramConfiguration, null, 4));
14
+
15
+ this.options.CommandOptions.push({ Name: '-f, --force', Description: 'Force overwrite anything in the package.json; use at your own quacking peril' });
16
+
17
+ this.options.Aliases.push('lux');
18
+
19
+ // Auto add the command on initialization
20
+ this.addCommand();
21
+ }
22
+
23
+ onRunAsync(fCallback)
24
+ {
25
+ // Execute the command
26
+ this.log.info(`Updating package.json...`);
27
+
28
+ let tmpOptions = this.CommandOptions;
29
+
30
+ // The package.json from the project we are quackin at
31
+ let tmpProjectPackage = JSON.parse(JSON.stringify(this.fable.AppData.Package));
32
+ let tmpPrototypePackage = JSON.parse(this.fable.parseTemplateByHash('PrototypePackage'));
33
+
34
+ console.log('')
35
+ let tmpQuackageConfigSections = Object.keys(tmpPrototypePackage);
36
+ for (let i = 0; i < tmpQuackageConfigSections.length; i++)
37
+ {
38
+ let tmpQuackageConfigSection = tmpQuackageConfigSections[i];
39
+ let tmpQuackageConfigSectionValue = tmpPrototypePackage[tmpQuackageConfigSection];
40
+
41
+ if (this.fable.DataFormat.stringStartsWith(tmpQuackageConfigSection, 'PackageSection-'))
42
+ {
43
+ // Get the package section name
44
+ let tmpPackageSectionName = tmpQuackageConfigSection.replace('PackageSection-', '');
45
+ let tmpPackageSectionExists = tmpProjectPackage.hasOwnProperty(tmpPackageSectionName);
46
+ let tmpSectionsMatch = (JSON.stringify(tmpProjectPackage[tmpPackageSectionName]) == JSON.stringify(tmpQuackageConfigSectionValue));
47
+
48
+ if (!tmpPackageSectionExists || tmpOptions.force)
49
+ {
50
+ this.log.info(` --> ${tmpProjectPackage.name}:${tmpProjectPackage.version}/package.json SECTION { ${tmpPackageSectionName}:... }: ${(tmpSectionsMatch && tmpPackageSectionExists) ? '[OK]' : '[NOT OK]'}`);
51
+ tmpProjectPackage[tmpPackageSectionName] = tmpQuackageConfigSectionValue;
52
+ }
53
+ }
54
+ }
55
+
56
+ console.log('')
57
+ if (!tmpProjectPackage.hasOwnProperty('scripts'))
58
+ {
59
+ this.log.error(`There is something egregiously wrong with ${this.fable.AppData.Package.name}:${this.fable.AppData.Package.version}/package.json ... no scripts object found in root. I will add it...`);
60
+ tmpProjectPackage.scripts = {};
61
+ }
62
+ let tmpQuackageScripts = Object.keys(tmpPrototypePackage.LuxuryPackageScripts);
63
+ for (let i = 0; i < tmpQuackageScripts.length; i++)
64
+ {
65
+ let tmpQuackageScriptKey = tmpQuackageScripts[i];
66
+ let tmpQuackageScriptValue = tmpPrototypePackage.LuxuryPackageScripts[tmpQuackageScriptKey];
67
+
68
+ let tmpScriptExists = tmpProjectPackage.scripts.hasOwnProperty(tmpQuackageScriptKey);
69
+ let tmpScriptMatches = (tmpProjectPackage.scripts[tmpQuackageScriptKey] == tmpQuackageScriptValue);
70
+
71
+ let tmpScriptOK = tmpScriptExists && tmpScriptMatches;
72
+
73
+ this.log.info(` --> ${this.fable.AppData.Package.name}:${this.fable.AppData.Package.version}/package.json SCRIPT { scripts.${tmpQuackageScriptKey} }: ${tmpScriptOK ? '[OK]' : '[NOT OK]'}`);
74
+ if (!tmpScriptOK)
75
+ {
76
+ if (tmpScriptExists)
77
+ {
78
+ this.log.info(` > Current Script: [${tmpProjectPackage.scripts[tmpQuackageScriptKey]}]`);
79
+ }
80
+ if (!tmpScriptMatches || !tmpScriptExists)
81
+ {
82
+ this.log.info(` > Quackage Script: [${tmpQuackageScriptValue}]`);
83
+ }
84
+ if (!tmpScriptExists || tmpOptions.force)
85
+ {
86
+ this.log.info(` > ${tmpScriptExists ? 'Updating' : 'Adding'} script [${tmpQuackageScriptKey}] ...`);
87
+ tmpProjectPackage.scripts[tmpQuackageScriptKey] = tmpQuackageScriptValue;
88
+ }
89
+ }
90
+ }
91
+
92
+ // Backing up the project package
93
+ this.log.info(`Backing up ${this.fable.AppData.CWD}/package.json to ${this.fable.AppData.CWD}/.package.json.quackage.bak ...`);
94
+ libFS.writeFileSync(`${this.fable.AppData.CWD}/.package.json.quackage.bak`, JSON.stringify(this.fable.AppData.Package, null, 4));
95
+ this.log.info(`Writing ${this.fable.AppData.CWD}/package.json ...`);
96
+ libFS.writeFileSync(`${this.fable.AppData.CWD}/package.json`, JSON.stringify(tmpProjectPackage, null, 4));
97
+
98
+ return fCallback();
99
+ };
100
+ }
101
+
102
+ module.exports = QuackageCommandUpdatePackage;
@@ -8,7 +8,7 @@ class QuackageCommandUpdatePackage extends libCommandLineCommand
8
8
  super(pFable, pManifest, pServiceHash);
9
9
 
10
10
  this.options.CommandKeyword = 'updatepackage';
11
- this.options.Description = 'Update your package.json to support testing, building and luxury configurations';
11
+ this.options.Description = 'Update your package.json to support streamlined testing, building and coverage';
12
12
 
13
13
  this.fable.TemplateProvider.addTemplate('PrototypePackage', JSON.stringify(this.pict.ProgramConfiguration, null, 4));
14
14
 
@@ -1,13 +1,39 @@
1
1
  const libPictView = require('pict-view');
2
2
 
3
- class PictSection{~PascalCaseIdentifier:AppData.Package.name~} extends libPictView
3
+ class {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~} extends libPictView
4
4
  {
5
5
  constructor(pFable, pOptions, pServiceHash)
6
6
  {
7
7
  super(pFable, pOptions, pServiceHash);
8
-
9
- this.log.info(`PictSection{~PascalCaseIdentifier:AppData.Package.name~}::constructor() executing...`);
10
8
  }
9
+
10
+ // The only thing that should be put in this constructor is internal state initialization (non AppData state)
11
11
  }
12
12
 
13
- module.exports = PictSection{~PascalCaseIdentifier:AppData.Package.name~};
13
+ module.exports = {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~};
14
+
15
+ module.exports.default_configuration =
16
+ {
17
+ ViewIdentifier: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}{~PascalCaseIdentifier:Record.Scope~}',
18
+ DefaultRenderable: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
19
+ DefaultDestinationAddress: '#BridgeInspectionNavigationContainer',
20
+ Templates:
21
+ [
22
+ {
23
+ Hash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
24
+ Template: /*html*/`
25
+ <!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} pict view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
26
+ <!-- {~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~} end view template: [{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template] -->
27
+ `,
28
+ },
29
+ ],
30
+ Renderables:
31
+ [
32
+ {
33
+ RenderableHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}',
34
+ TemplateHash: '{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}-{~PascalCaseIdentifier:Record.Scope~}-Template',
35
+ DestinationAddress: '#{~PascalCaseIdentifier:Record.Quackage.AppData.Package.name~}_{~PascalCaseIdentifier:Record.Scope~}_Container',
36
+ RenderMethod: 'replace'
37
+ },
38
+ ]
39
+ };
@@ -0,0 +1,95 @@
1
+ /*
2
+ Unit tests for {~Data:Record.Scope~} in {~Data:Record.Quackage.AppData.Package.name~} from Quackage Boilerplate
3
+ */
4
+
5
+ // This is used to grab the source file from the package.json
6
+ const _Package = require(`../package.json`);
7
+ // Get the "main" view from the package.json
8
+ // If you want to test a specific subview, you can delete the above line and change the require below to the specific file.
9
+ const libPictView = require(`../${_Package.main}`);
10
+
11
+ // Mocha, chai and the Expect verb
12
+ const Chai = require("chai");
13
+ const Expect = Chai.expect;
14
+
15
+ // This extends node to have the browser environment globals like window and document.
16
+ const libBrowserEnv = require('browser-env')
17
+ libBrowserEnv();
18
+
19
+ const libPict = require('pict');
20
+
21
+ const _MockPictConfiguration = (
22
+ {
23
+ Product: 'MockPict-ViewTest',
24
+ ProductVersion: _Package.version
25
+ });
26
+
27
+ // Any view-specific configuration goes here.
28
+ // If there is no default_configuration object exported with your view, use an empty JSON object
29
+ const _MockPictViewConfiguration = (typeof(libPictView.default_configuration) === 'undefined') ? {} : libPictView.default_configuration;
30
+
31
+ suite
32
+ (
33
+ '{~Data:Record.Quackage.AppData.Package.name~} Pict View Suite',
34
+ function()
35
+ {
36
+ setup
37
+ (
38
+ function()
39
+ {
40
+ }
41
+ );
42
+
43
+ suite
44
+ (
45
+ 'Low Level',
46
+ function()
47
+ {
48
+ test
49
+ (
50
+ 'View Construction',
51
+ function(fDone)
52
+ {
53
+ var testPict = new libPict(_MockPictConfiguration);
54
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
55
+ Expect(testView).to.be.an('object');
56
+ Expect(testPict.views.TestView).to.be.an('object');
57
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
58
+ return fDone();
59
+ }
60
+ );
61
+ test
62
+ (
63
+ 'View Initialization',
64
+ function(fDone)
65
+ {
66
+ var testPict = new libPict(_MockPictConfiguration);
67
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
68
+ testView.initialize();
69
+ Expect(testView).to.be.an('object');
70
+ Expect(testPict.views.TestView).to.be.an('object');
71
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
72
+ return fDone();
73
+ }
74
+ );
75
+ test
76
+ (
77
+ 'View Initialization (async)',
78
+ function(fDone)
79
+ {
80
+ var testPict = new libPict(_MockPictConfiguration);
81
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
82
+ testView.initializeAsync(
83
+ (fCallback) =>
84
+ {
85
+ Expect(testView).to.be.an('object');
86
+ Expect(testPict.views.TestView).to.be.an('object');
87
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
88
+ return fDone();
89
+ });
90
+ }
91
+ );
92
+ }
93
+ );
94
+ }
95
+ );
@@ -0,0 +1,95 @@
1
+ /*
2
+ Unit tests for {~Data:Record.Scope~} in {~Data:Record.Quackage.AppData.Package.name~} from Quackage Boilerplate
3
+ */
4
+
5
+ // This is used to grab the source file from the package.json
6
+ const _Package = require(`../package.json`);
7
+ // Get the "main" view from the package.json
8
+ // If you want to test a specific subview, you can delete the above line and change the require below to the specific file.
9
+ const libPictView = require(`../${_Package.main}`);
10
+
11
+ // Mocha, chai and the Expect verb
12
+ const Chai = require("chai");
13
+ const Expect = Chai.expect;
14
+
15
+ // This extends node to have the browser environment globals like window and document.
16
+ const libBrowserEnv = require('browser-env')
17
+ libBrowserEnv();
18
+
19
+ const libPict = require('pict');
20
+
21
+ const _MockPictConfiguration = (
22
+ {
23
+ Product: 'MockPict-ViewTest',
24
+ ProductVersion: _Package.version
25
+ });
26
+
27
+ // Any view-specific configuration goes here.
28
+ // If there is no default_configuration object exported with your view, use an empty JSON object
29
+ const _MockPictViewConfiguration = (typeof(libPictView.default_configuration) === 'undefined') ? {} : libPictView.default_configuration;
30
+
31
+ suite
32
+ (
33
+ '{~Data:Record.Quackage.AppData.Package.name~} Pict View Suite',
34
+ function()
35
+ {
36
+ setup
37
+ (
38
+ function()
39
+ {
40
+ }
41
+ );
42
+
43
+ suite
44
+ (
45
+ 'Low Level',
46
+ function()
47
+ {
48
+ test
49
+ (
50
+ 'View Construction',
51
+ function(fDone)
52
+ {
53
+ var testPict = new libPict(_MockPictConfiguration);
54
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
55
+ Expect(testView).to.be.an('object');
56
+ Expect(testPict.views.TestView).to.be.an('object');
57
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
58
+ return fDone();
59
+ }
60
+ );
61
+ test
62
+ (
63
+ 'View Initialization',
64
+ function(fDone)
65
+ {
66
+ var testPict = new libPict(_MockPictConfiguration);
67
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
68
+ testView.initialize();
69
+ Expect(testView).to.be.an('object');
70
+ Expect(testPict.views.TestView).to.be.an('object');
71
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
72
+ return fDone();
73
+ }
74
+ );
75
+ test
76
+ (
77
+ 'View Initialization (async)',
78
+ function(fDone)
79
+ {
80
+ var testPict = new libPict(_MockPictConfiguration);
81
+ let testView = testPict.addView('TestView', _MockPictViewConfiguration, libPictView);
82
+ testView.initializeAsync(
83
+ (fCallback) =>
84
+ {
85
+ Expect(testView).to.be.an('object');
86
+ Expect(testPict.views.TestView).to.be.an('object');
87
+ Expect(testView.UUID).to.equal(testPict.views.TestView.UUID);
88
+ return fDone();
89
+ });
90
+ }
91
+ );
92
+ }
93
+ );
94
+ }
95
+ );
@@ -1,81 +0,0 @@
1
- /*
2
- Unit tests for LIBRARYNAMEHERE Basic
3
- */
4
-
5
- const _Package = require(`../package.json`);
6
-
7
- // This is temporary, but enables unit tests
8
- const libBrowserEnv = require('browser-env')
9
- libBrowserEnv();
10
-
11
- const Chai = require('chai');
12
- const Expect = Chai.expect;
13
-
14
- const libPict = require('pict');
15
-
16
- const configureTestPict = (pPict) =>
17
- {
18
- let tmpPict = (typeof(pPict) == 'undefined') ? new libPict() : pPict;
19
- tmpPict.TestData = (
20
- {
21
- Reads: [],
22
- Assignments: [],
23
- Appends: [],
24
- Gets: []
25
- });
26
- tmpPict.ContentAssignment.customReadFunction = (pAddress, pContentType) =>
27
- {
28
- tmpPict.TestData.Reads.push(pAddress);
29
- tmpPict.log.info(`Mocking a read of type ${pContentType} from Address: ${pAddress}`);
30
- return '';
31
- }
32
- tmpPict.ContentAssignment.customGetElementFunction = (pAddress) =>
33
- {
34
- tmpPict.TestData.Gets.push(pAddress);
35
- tmpPict.log.info(`Mocking a get of Address: ${pAddress}`);
36
- return '';
37
- }
38
- tmpPict.ContentAssignment.customAppendElementFunction = (pAddress, pContent) =>
39
- {
40
- tmpPict.TestData.Appends.push(pAddress);
41
- tmpPict.log.info(`Mocking an append of Address: ${pAddress}`, {Content: pContent});
42
- return '';
43
- }
44
- tmpPict.ContentAssignment.customAssignFunction = (pAddress, pContent) =>
45
- {
46
- tmpPict.TestData.Assignments.push(pAddress);
47
- tmpPict.log.info(`Mocking an assignment of Address: ${pAddress}`, {Content: pContent});
48
- return '';
49
- }
50
-
51
- return tmpPict;
52
- }
53
-
54
- const libPictExtension = require(`../${_Package.main}`);
55
-
56
- suite
57
- (
58
- `Basic ${_Package.name}.v.${_Package.version} tests`,
59
- () =>
60
- {
61
- setup(() => { });
62
-
63
- suite
64
- (
65
- 'Basic Basic Tests',
66
- () =>
67
- {
68
- test(
69
- 'Constructor properly crafts an object',
70
- (fDone) =>
71
- {
72
- let _Pict = configureTestPict();
73
- let _PictExtension = _Pict.addView({}, 'Pict-Test-{~RandomNumberString:4,9000~}', libPictExtension);
74
- Expect(_PictExtension).to.be.an('object');
75
- return fDone();
76
- }
77
- );
78
- }
79
- );
80
- }
81
- );
@@ -1,79 +0,0 @@
1
- /*
2
- Unit tests for Pict View: {~PascalCaseIdentifier:AppData.Package.name~}
3
- */
4
-
5
- // This is temporary, but enables unit tests
6
- const libBrowserEnv = require('browser-env')
7
- libBrowserEnv();
8
-
9
- const Chai = require('chai');
10
- const Expect = Chai.expect;
11
-
12
- const libPict = require('pict');
13
-
14
- const configureTestPict = (pPict) =>
15
- {
16
- let tmpPict = (typeof(pPict) == 'undefined') ? new libPict() : pPict;
17
- tmpPict.TestData = (
18
- {
19
- Reads: [],
20
- Assignments: [],
21
- Appends: [],
22
- Gets: []
23
- });
24
- tmpPict.ContentAssignment.customReadFunction = (pAddress, pContentType) =>
25
- {
26
- tmpPict.TestData.Reads.push(pAddress);
27
- tmpPict.log.info(`Mocking a read of type ${pContentType} from Address: ${pAddress}`);
28
- return '';
29
- }
30
- tmpPict.ContentAssignment.customGetElementFunction = (pAddress) =>
31
- {
32
- tmpPict.TestData.Gets.push(pAddress);
33
- tmpPict.log.info(`Mocking a get of Address: ${pAddress}`);
34
- return '';
35
- }
36
- tmpPict.ContentAssignment.customAppendElementFunction = (pAddress, pContent) =>
37
- {
38
- tmpPict.TestData.Appends.push(pAddress);
39
- tmpPict.log.info(`Mocking an append of Address: ${pAddress}`, {Content: pContent});
40
- return '';
41
- }
42
- tmpPict.ContentAssignment.customAssignFunction = (pAddress, pContent) =>
43
- {
44
- tmpPict.TestData.Assignments.push(pAddress);
45
- tmpPict.log.info(`Mocking an assignment of Address: ${pAddress}`, {Content: pContent});
46
- return '';
47
- }
48
-
49
- return tmpPict;
50
- }
51
-
52
- const lib{~PascalCaseIdentifier:AppData.Package.name~} = require(`../{~Data:AppData.Package.main~}`);
53
-
54
- suite
55
- (
56
- 'Pict View: {~PascalCaseIdentifier:AppData.Package.name~}',
57
- () =>
58
- {
59
- setup(() => { });
60
-
61
- suite
62
- (
63
- 'Basic Tests',
64
- () =>
65
- {
66
- test(
67
- 'Object Initialization',
68
- (fDone) =>
69
- {
70
- let _Pict = configureTestPict();
71
- let _PictView{~PascalCaseIdentifier:AppData.Package.name~} = _Pict.addView({}, 'Pict-View-{~PascalCaseIdentifier:AppData.Package.name~}', lib{~PascalCaseIdentifier:AppData.Package.name~});
72
- Expect(_PictView{~PascalCaseIdentifier:AppData.Package.name~}).to.be.an('object');
73
- return fDone();
74
- }
75
- );
76
- }
77
- );
78
- }
79
- );