{"id":15688234,"url":"https://github.com/jamiemason/phantomjs-test-starter","last_synced_at":"2025-10-24T00:12:06.213Z","repository":{"id":12082854,"uuid":"14670594","full_name":"JamieMason/phantomjs-test-starter","owner":"JamieMason","description":"A boilerplate / starter template for testing PhantomJS ‘Applications’ with Jasmine, Grunt and Istanbul","archived":false,"fork":false,"pushed_at":"2016-11-25T08:48:18.000Z","size":158,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T07:41:31.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamieMason.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-24T22:20:51.000Z","updated_at":"2016-11-25T08:48:19.000Z","dependencies_parsed_at":"2022-09-01T14:41:42.722Z","dependency_job_id":null,"html_url":"https://github.com/JamieMason/phantomjs-test-starter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fphantomjs-test-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fphantomjs-test-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fphantomjs-test-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fphantomjs-test-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/phantomjs-test-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954376,"owners_count":21830902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:56:24.833Z","updated_at":"2025-10-24T00:12:06.132Z","avatar_url":"https://github.com/JamieMason.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phantomjs-test-starter\n\nA boilerplate / starter template for testing [PhantomJS](http://phantomjs.org) ‘Applications’ with [Jasmine](https://jasmine.github.io/), [Grunt](http://gruntjs.com) and [Istanbul](http://gotwarlost.github.io/istanbul/).\n\nThere are many resources on how to run tests in PhantomJS, but none on testing Applications written in PhantomJS _itself_. Non-Trivial Applications such as Data Mining Web Crawlers or Web Page Automation Tools for example.\n\nConceptually I find it helps to think of PhantomJS as having a server-side and a client-side. The client-side is what happens over in a remote page (inside calls to [WebPage.evaluate](http://phantomjs.org/api/webpage/method/evaluate.html) etc) and the server side is everything else.\n\nThis project is concerned with how you test the so-called server side of a PhantomJS Application.\n\n## Installation\n\n### NPM\n\n```bash\nnpm install phantomjs-test-starter\n```\n\n### Git\n\n```bash\ngit clone git@github.com:JamieMason/phantomjs-test-starter.git\ncd phantomjs-test-starter\nnpm install\n```\n\n## Global dependencies\n\nLocal dependencies are installed by `npm install` but you will also need `$ phantomjs` (of course) and `npm install -g grunt-cli`.\n\n## Running tests\n\nRunning `grunt test` will run the tests and generate a coverage report at **./spec/build/reports/index.html**.\n\n## Writing tests\n\nBy optional convention, tests are located at **./spec/unit/** at the same relative path as the file being tested.\n\nFor example, tests for the following files:\n\n+ ./src/modules/network/ajax.js\n+ ./src/modules/events.js\n+ ./src/modules/data/local-storage.js\n\nWould be located at:\n\n+ ./spec/unit/modules/network/ajax.spec.js\n+ ./spec/unit/modules/events.spec.js\n+ ./spec/unit/modules/data/local-storage.spec.js\n\n## Adding new tests\n\nAll test files are passed to **./spec/unit/unit.runner.js** by Grunt via a command line argument to phantomjs.\n\n## Modified Jasmine 1.3.1\n\nA slightly modified version of [jasmine-standalone-1.3.1](https://github.com/jasmine/jasmine/releases/download/v1.3.1/jasmine-standalone-1.3.1.zip) is needed as that does not run in PhantomJS (outside of a page.evaluate that is, which is not relevant to our use case).\n\nThis is due to a perfectly reasonable assumption that any JavaScript environment will have either module.exports _or_ window and **not both** — which is the case in PhantomJS.\n\nThe core Jasmine library is identical, only how it's exposed has been modified.\n\n## .gitignore\n\nThey've been left unignored for this example so can see what gets generated during tests, but in a real application you will want to ignore:\n\n+ spec/build\n\n## Contributing\n\nPlease [fork and pull request](https://github.com/JamieMason/phantomjs-test-starter/fork) or [raise an issue](https://github.com/JamieMason/phantomjs-test-starter/issues/new) if you can help improve this resource in any way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fphantomjs-test-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiemason%2Fphantomjs-test-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fphantomjs-test-starter/lists"}