NH_base

Base library usable any time.

Ezek a szkript azon változatai, ahol a kód módosítva lett. Minden verzió mutatása

  • v52 2024.02.25.

    Implement base Exception class that will use the name of the class.

    When exception types inherit from Error, the name property sticks with the string "Error", making logs less useful.

    Issue #259.

    Bump version number.

  • v51 2024.02.14.

    Stop using event as a local name as it shadows a global.

    Issue #238.

    Bump version number.

  • v50 2024.02.12.

    Migrate Service to lib/base.

    Issue #167.

    Bump version number.

  • v49 2024.02.08.

    Normalize vertical white space around logging {intro,outro}s.

    Closes #243.

    Bump version number.

  • v48 2024.01.09.

    JSDoc: Correct @typedef

    Bump version number.

  • v47 2024.01.06.

    Call a real console method to generate a stack trace.

    Closes #226.

    Bump version number.

  • v46 2024.01.02.

    Minor tweak to wording in error message.

    Bump version number.

  • v45 2023.12.19.

    Migrate asserts to using supported new constructs.

    Issue #183.

    Support chaining with Dispatcher.{on,off,fire}().

    Closes #207.

    Bump version number.

  • v44 2023.12.14.

    Add descriptive text to some assertions.

    Issue #215.

    Bump version number.

  • v43 2023.12.08.

    Add descriptive text to the assertEqual() in a loop.

    Issue #215.

    Bump version number.

  • v42 2023.12.05.

    Update exports and documentation to match current file order.

    Promote ONE_ITEM to a global constant.

    Issue #216.

    Bump version number.

  • v41 2023.12.04.

    Make use of new TestCase features in testing.

    Issue #183.

    Bump version number.

  • v40 2023.12.02.

    Wrap call to console.error() with a MessageQueue.

    Just to make it easier to test.

    Issue #210.

    Replace a loop around a push() with the spread syntax.

    Bump version number.

  • v39 2023.12.01.

    Move MessageQueue and friends higher in the file.

    Issue #210.

    Bump version number.

  • v38 2023.11.29.

    Move Dispatcher higher in the file and write tests.

    Issue #210.

    Bump version number.

  • v37 2023.11.26.

    Update comment now that we have a plan.

    Issue #210.

    Bump version number.

  • v36 2023.11.24.

    Implement a simple message queuing system, MessageQueue.

    Issue #205.

    Expose a common issue collection for libraries and apps.

    Issue #205.

    Bump version number.

  • v35 2023.11.22.

    eslint: Deal with some upcoming tweaks to newline-per-chained-call.

    Issue #203.

    Bump version number.

  • v34 2023.11.18.

    Retire NH.xunit.testing.log and replace with local Logger.

    Issue #179.

    style-nudge: Right place nested classes in Logger.

    Issue #197.

    Bump version number.

  • v33 2023.11.16.

    Use the new TestResult.summary() feature.

    Issue #200.

    Retire now unused doFunctionTests().

    Issue #179.

    Bump version number.

  • v32 2023.11.15.

    Rewrite testLogger() as a TestCase.

    Issue #179.

    Bump version number.

  • v31 2023.11.14.

    Rewrite Logger.#testGroupMode() as a TestCase.

    Issue #179.

    Bump version number.

  • v30 2023.11.13.

    Only reset Logger instances that have configs when restored.

    Closes #199.

    Add some vertical whitespace.

    Rewrite testSafeId() as a TestCase.

    Issue #179.

    Bump version number.

  • v29 2023.11.12.

    Rewrite testDefaultMap() as a TestCase.

    Issue #179.

    Bump version number.

  • v28 2023.11.10.

    Rewrite testNumberOp() as a TestCase.

    Issue #179.

    Bump version number.

  • v27 2023.11.09.

    Explicitly log fields in a failure.

    We are starting to add some formatting to failure messages, and this will make them apparent in the logs.

    Issue #183.

    Rewrite testEnsure() as a TestCase.

    Turns out there was a mistake, and being a Map resulting in one test being overwritten by another one registered.

    Also normalized casing of text in the exceptions and other minor cleanups.

    Issue #179.

    Bump version number.

  • v26 2023.11.08.

    Bump minVersion of lib/xunit.

    Necessary to ensure TestCase.assertEqual().

    Issue #180.

    Bump version numbers.

  • v25 2023.11.07.

    Reset the existing loggers after configs are changed.

    We were setting the global config section, but each Logger instance actually contained its own copy. This made changing configs at runtime impossible.

    Amusingly enough, this was planned for, by tracking the loggers, but we forgot to actually make use of it.

    Issue #145.

    style-nudge: Right place #private fields in Logger.

    Issue #173.

    Bump version numbers.

  • v24 2023.11.05.

    Improved error message on library version failure.

    Improved error message on using wrong Dispatcher eventType.

    Bump version numbers.

  • v23 2023.11.04.

    style-nudge: Right place getters in Logger.#GroupMode.

    Issue #173.

    style-nudge: Right place a getter in Logger.

    Issue #173.

    Bump version numbers.

  • v22 2023.11.03.

    style-nudge: Right place a property in Logger.#Config.

    Issue #173.

    Bump version numbers.

  • v21 2023.11.02.

    Implement simpleParseWords().

    This will replace SPA._parseHeader().

    Issue #180.

    Bump version numbers.

  • v20 2023.11.01.

    Stop exporting the legacy testing object.

    Issue #167.

    Bump version numbers.

  • v19 2023.10.28.

    Give each test failure its own log entry.

    Issue #172.

    Bump version numbers.

  • v18 2023.10.28.

    Bump min version for lib/xunit; have test runners give a result code.

    Issue #172.

    Bump version numbers.

  • v17 2023.10.27.

    Move internal functions outside of runTests().

    Issue #172.

    Bump version numbers.

  • v16 2023.10.27.

    Have ensure() return a restricted namespace.

    This should reduce use of undeclared dependencies.

    Issue #175.

    The variable result should be singular.

    Issue #172.

    Bump version numbers.

  • v15 2023.10.25.

    Depend on lib/xunit version 0.

    Issue #167.

    Have lib/base use testing from lib/xunit.

    Currently rexports it until the next release.

    Issues #167, #172.

    Bump version numbers.

  • v14 2023.10.25.

    Oops, dropped a period after the last comment change.

    Start refactoring testing into its own library.

    Issues #167, #172.

    Bump version numbers.

  • v13 2023.10.24.

    Add fields and methods to TestResult.

    Also moved it to just above TestRunner.

    Issue #172.

    Bring lib/base.{js,md} into sync.

    Issue #167.

    Track skipping or errors during TestCase.setUpClass.

    Issue #172.

    Bump version numbers.

  • v12 2023.10.22.

    Document how to effectively use Logger.

    Issue #145.

    Forgot to export the new ensure function.

    Issue #167.

    Bump version numbers.

  • v11 2023.10.21.

    Add a sequence number to Logger.

    Each logger instance, and individual groups, are updated to the current sequence upon use. The current sequence number grows each time configurations are restored from a saved state.

    If exposed to the end users, they will be able to use the sequence number as an indicator of the last time a particular logger or group was used. Useful if they want to clean up old settings they have (perhaps a logger was renamed, or a particular group no longer exists). It could also be used to rediscover perhaps forgotten features of the program.

    Issue #145.

    Bump version numbers.

  • v10 2023.10.19.

    Include call counts in Logger's restore config tests.

    Issue #145.

    Move Logger.#Group pojo handling into #Group.

    Issue #145.

    Add ensure() for library validation.

    Because I wanted to use something different than require.

    Issue #167.

    Replace TestCase.run with a dedicated TestRunner class.

    Issue #172.

    Bump version numbers.

  • v9 2023.10.19.

    Make NumberOp more robust against assigning null or undefined.

    This does move NumberOp a bit more away from the built-in Number class, but more useful.

    Issue #145.

    Fix a bug in Logger.#outro and normalize #intro.

    #outro was calling the actual log method after the group was popped, meaning the message was being controlled by the wrong mode. Since modes are fairly new, this had gone unnoticed.

    In fixing this, the actual logging was moved outside of the ending of the group. Updated #intro to be similar for consistency. (Though both of these will result in more accurate stats in the next change.)

    Issue #145.

    Add call counts to Logger.

    Both the logger itself, and the individual groups, now have counts.

    Users can use these counts to determine to identify where they may be excessive logging, or help figure out which loggers should be disabled or groups silenced when debugging.

    Issue #145.

    Migrate Dispatcher to lib/base.

    Issue #167.

    Enhance test runner to loop over the new TestCases.

    Issue #172.

    Rename FooTestCase to TestTestCase.

    Issue #172.

    Add missing space in comment.

    Rename TestCase.#classCleanups as classCleanups.

    That darned JavaScript issue where subclasses cannot update the #private properties of base classes.

    Issue #172.

    Have TestCase.run() call class setup and cleanups.

    Issue #172.

    Bump version numbers.

  • v8 2023.10.18.

    Move a constant closer to the top of the file.

    Issue #167.

    Create a simple test runner.

    Issue #172.

    Make Logger groups always have a default name and mode.

    This does mean that a plain log() invocation outside of a group gets the name null and defaults to opened.

    Issue #145.

    Bump version number.

  • v7 2023.10.17.

    Enhance DefaultMap to let the factory function take arguments.

    Issue #145.

    Change Logger.#groups to be a DefaultMap.

    This simplifies the code a bit, and will allow for a future enhancement.

    Issue #145.

    Bump version number.

  • v6 2023.10.16.

    Start an xUnit style test framework.

    Not ready yet.

    Issue #167.

    Minor test cleanups.

    Issue #145.

    Migrate uuId, safeId, and strHash to lib/base.

    Issue #167.

    Bump version number.

  • v5 2023.10.15.

    Create Logger.#Group and move GroupMode into it.

    We are soon going to have more items to track by group than just mode.

    This does change the API a bit, but we had already make an incompatible change when we made GroupMode private anyway. Since we currently still only have one known user, I think this is still a safe change to make.

    Issue #145.

    Bump version number.

  • v4 2023.10.15.

    Add a NumberOp class that supports operator methods.

    Currently only supports the add operator and basic type coercion methods.

    Also converted one of the DefaultMap tests to use this, as that is similar to why this class is needed.

    Issue #145.

    Add assign method to NumberOp.

    Allows an existing instance to get a new value.

    Issue #145.

  • v4 2023.10.15.

    eslint: Reconfigure no-multiple-empty-lines along with fix-ups.

    Rename trace to includeStackTrace.

    Now that this can be toggled with a few clicks, can make the name a bit longer.

    Issue #167.

    Retire Bob.

    I like Bob. But, Bob was confusing. But do not fear! Bob is still here part-time.

    Issue #167.

    Freeze #GroupMode instances.

    We verified the class was frozen, but not the instances.

    Issue #145.

    Add a NumberOp class that supports operator methods.

    Currently only supports the add operator and basic type coercion methods.

    Also converted one of the DefaultMap tests to use this, as that is similar to why this class is needed.

    Issue #145.

    Add assign method to NumberOp.

    Allows an existing instance to get a new value.

    Issue #145.

Mutasd a szkript összes verzióját