{"id":16284099,"url":"https://github.com/camel-chased/promiseloop","last_synced_at":"2026-04-24T16:02:51.604Z","repository":{"id":65475859,"uuid":"83090393","full_name":"camel-chased/promiseloop","owner":"camel-chased","description":"for testing nested promises","archived":false,"fork":false,"pushed_at":"2017-02-26T18:36:46.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T21:35:47.357Z","etag":null,"topics":["jasmine","nested-promises","promise","promises","test","testing","tests"],"latest_commit_sha":null,"homepage":null,"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/camel-chased.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":"2017-02-24T23:06:20.000Z","updated_at":"2017-02-24T23:18:16.000Z","dependencies_parsed_at":"2023-01-25T06:15:16.527Z","dependency_job_id":null,"html_url":"https://github.com/camel-chased/promiseloop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/camel-chased/promiseloop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-chased%2Fpromiseloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-chased%2Fpromiseloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-chased%2Fpromiseloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-chased%2Fpromiseloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camel-chased","download_url":"https://codeload.github.com/camel-chased/promiseloop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-chased%2Fpromiseloop/sbom","scorecard":{"id":263597,"data":{"date":"2025-08-11","repo":{"name":"github.com/camel-chased/promiseloop","commit":"60f156b545ad325a908a3b15df254a47d7244359"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T11:23:53.265Z","repository_id":65475859,"created_at":"2025-08-17T11:23:53.265Z","updated_at":"2025-08-17T11:23:53.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["jasmine","nested-promises","promise","promises","test","testing","tests"],"created_at":"2024-10-10T19:18:18.774Z","updated_at":"2026-04-24T16:02:51.586Z","avatar_url":"https://github.com/camel-chased.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# promiseloop\nThis package was developed to resolve testing issues with nested promises and timing mocks but can be used elsewhere as well - it is kind of generous.\n\nWith this module you can test something on each level of `Promise.then` with multiple promises run simultanousely.\n\nIt can be used to check something on each level of `then` method.\n`then` method is executed in most cases with `setImmediate` or `process.nextTick` so it is hard to test future \"ticks\" in synchronous way for example setTimeout inside `then` will not be catched by timer mocks because `setTimeout` inside `then` will be fired in the future (ticks).\n`promiseloop` is going through all levels of ticks and can catch all those `setTimout`s or other things that are executed in next (future) ticks.\n\nHere you can read about the problem: http://stackoverflow.com/questions/42446795/how-to-use-jasmine-clock-settimeout-in-nested-promises-when-order-matters-ja\n\n\n## usage\n\n```\nnpm install promiseloop\n\n\nlet promiseLoop = require('promiseloop')(Promise);\n// where Promise is your Promise implementation\n```\n\n```javascript\nlet levelsDeep = 10; // how deep we want to go through 'then' levels?\nfunction iterationFn(){\n  // this function will be executed in each level of 'then'\n  // each level of 'then' is in most cases something like setImmediate or nextTick\n}\nfunction finalFn(){\n  // this function will be executed at the end of the chain - final\n}\npromiseLoop(levelsDeep,iterationFn,finalFn);\n```\n\nwe can only have finalFn instead of iteration\n\n```javascript\nlet levelsDeep = 10; // how deep we want to go through 'then' levels?\nfunction finalFn(){\n  // this function will be executed at the end of the chain - final\n}\npromiseLoop(levelsDeep,finalFn);\n```\n\nFor example if you need to test multiple promises and you does not want to make sophisticated algorithm to check that everything is already executed on each level.\n\n```javascript\nlet testNr=0;\n\nnew Promise((resolve,reject)=\u003e{\n  resolve(\"ok\");\n}).then(()=\u003e{\n  // level 1\n  testNr++; // 1\n}).then(()=\u003e{\n  // level 2\n  testNr++; // 3\n});\n\nnew Promise((resolve,reject)=\u003e{\n  resolve(\"ok\");\n}).then(()=\u003e{\n  // level 1\n  testNr++; // 2\n}).then(()=\u003e{\n  // level 2\n  testNr++; // 4\n});\n\nfunction each(currentLevel){\n  if(currentLevel==1){\n    expect(testNr).toEqual(2);\n  }else if(currentLevel==2){\n    expect(testNr).toEqual(4);\n  }\n}\nfunction final(){\n  expect(testNr).toEqual(4);\n  done();\n}\npromiseLoop(3,each,final);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamel-chased%2Fpromiseloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamel-chased%2Fpromiseloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamel-chased%2Fpromiseloop/lists"}